Sha256: cd545f0c082fc945a8687493065288f57c666c0f67cad15f9b56481dc4c97225

Contents?: true

Size: 216 Bytes

Versions: 13

Compression:

Stored size: 216 Bytes

Contents

require 'optparse'
parser = OptionParser.new
parser.on('-x', 'One short name') do |value|
  p ['-x', value]
end
parser.on('-1', '-%', 'Two short names (aliases)') do |value|
  p ['-1 or -%', value]
end
parser.parse!

Version data entries

13 entries across 13 versions & 3 rubygems

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