Sha256: 65d85a60346770084cf0e36b4b3f1368050434922b2e9c3c781ceae7d7f3ccfb

Contents?: true

Size: 263 Bytes

Versions: 13

Compression:

Stored size: 263 Bytes

Contents

require 'optparse'
parser = OptionParser.new
parser.on('-xXXX', ['foo', 'bar'], 'Values for required argument' ) do |value|
  p ['-x', value]
end
parser.on('-y [YYY]', ['baz', 'bat'], 'Values for optional argument') do |value|
  p ['-y', value]
end
parser.parse!

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
optparse-0.6.0 doc/optparse/ruby/explicit_array_values.rb
optparse-0.5.0 doc/optparse/ruby/explicit_array_values.rb
cli-option_parser.rb-0.6.0 doc/optparse/ruby/explicit_array_values.rb
cli-option_parser.rb-0.5.3 doc/optparse/ruby/explicit_array_values.rb
cli-option_parser.rb-0.5.2 doc/optparse/ruby/explicit_array_values.rb
cmd-optparse.rb-0.5.2 doc/optparse/ruby/explicit_array_values.rb
cmd-optparse.rb-0.5.0 doc/optparse/ruby/explicit_array_values.rb
cmd-optparse.rb-0.1.1 doc/optparse/ruby/explicit_array_values.rb
cmd-optparse.rb-0.1.0 doc/optparse/ruby/explicit_array_values.rb
optparse-0.4.0 doc/optparse/ruby/explicit_array_values.rb
optparse-0.3.1 doc/optparse/ruby/explicit_array_values.rb
optparse-0.3.0 doc/optparse/ruby/explicit_array_values.rb
optparse-0.2.0 doc/optparse/ruby/explicit_array_values.rb