ruby/doc/tutorial/short_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
168 B
Ruby

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