Sha256: a047be0555f408ce943e3507e5a7d78ed80fe8436353521403bfc4544a163c82

Contents?: true

Size: 232 Bytes

Versions: 13

Compression:

Stored size: 232 Bytes

Contents

require 'optparse'
parser = OptionParser.new
parser.on('--xxx', 'One long name') do |value|
  p ['--xxx', value]
end
parser.on('--y1%', '--z2#', 'Two long names (aliases)') do |value|
  p ['--y1% or --z2#', value]
end
parser.parse!

Version data entries

13 entries across 13 versions & 3 rubygems

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