ruby/doc/tutorial/long_names.rb
Burdette Lamar 05e9efa323
[ruby/optparse] More on tutorial (https://github.com/ruby/optparse/pull/9)
* More on tutorial

* More on tutorial

* More on tutorial

* More on tutorial: clearer example output

84dfd92d2a
2021-07-28 20:13:38 +09:00

9 lines
186 B
Ruby

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