ruby/doc/optparse/ruby/argument_keywords.rb

7 строки
152 B
Ruby

require 'optparse'
parser = OptionParser.new
parser.on('-x', '--xxx', :REQUIRED, 'Required argument') do |value|
p ['--xxx', value]
end
parser.parse!