Sha256: bec53394361a7b9133ee1fd7812992aac8588a08d30895d9936473b7a651abeb

Contents?: true

Size: 375 Bytes

Versions: 13

Compression:

Stored size: 375 Bytes

Contents

require 'optparse'
parser = OptionParser.new
def xxx_handler(value)
  p ['Handler method for -xxx called with value:', value]
end
parser.on('--xxx', 'Option with no argument', method(:xxx_handler))
def yyy_handler(value)
  p ['Handler method for -yyy called with value:', value]
end
parser.on('--yyy YYY', 'Option with required argument', method(:yyy_handler))
parser.parse!

Version data entries

13 entries across 13 versions & 3 rubygems

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