Sha256: ad675e1abd34079dfea08054a3028f612ee8214dbfde5e585c63db4dce9cd08a

Contents?: true

Size: 286 Bytes

Versions: 9

Compression:

Stored size: 286 Bytes

Contents

require 'optparse'
parser = OptionParser.new
parser.on('-x', '--xxx=VALUE', %w[ABC def], 'Argument abbreviations') do |value|
  p ['--xxx', value]
end
parser.on('-y', '--yyy=VALUE', {"abc"=>"XYZ", def: "FOO"}, 'Argument abbreviations') do |value|
  p ['--yyy', value]
end
parser.parse!

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
optparse-0.6.0 doc/optparse/ruby/argument_abbreviation.rb
optparse-0.5.0 doc/optparse/ruby/argument_abbreviation.rb
cli-option_parser.rb-0.6.0 doc/optparse/ruby/argument_abbreviation.rb
cli-option_parser.rb-0.5.3 doc/optparse/ruby/argument_abbreviation.rb
cli-option_parser.rb-0.5.2 doc/optparse/ruby/argument_abbreviation.rb
cmd-optparse.rb-0.5.2 doc/optparse/ruby/argument_abbreviation.rb
cmd-optparse.rb-0.5.0 doc/optparse/ruby/argument_abbreviation.rb
cmd-optparse.rb-0.1.1 doc/optparse/ruby/argument_abbreviation.rb
cmd-optparse.rb-0.1.0 doc/optparse/ruby/argument_abbreviation.rb