Sha256: 492438fc8562f67afc5828372333ce5b9dc9ca00ab1b2dcbbbb11112efa87401

Contents?: true

Size: 286 Bytes

Versions: 13

Compression:

Stored size: 286 Bytes

Contents

require 'optparse'
parser = OptionParser.new
parser.on('-x', '--xxx', 'Short and long, no argument')
parser.on('-yYYY', '--yyy', 'Short and long, required argument')
parser.on('-z [ZZZ]', '--zzz', 'Short and long, optional argument')
options = {}
parser.parse!(into: options)
p options

Version data entries

13 entries across 13 versions & 3 rubygems

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