1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/doc/tutorial/short_names.rb
Burdette Lamar fe72cff487
[ruby/optparse] More on tutorial (#9)
* More on tutorial: clearer example output

84dfd92d2a
2021-04-08 12:11:32 +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!