mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00

* Resolve shared mixed_names.rb
* Add long option with negation
* Show --help for all examples
* Table of contents for tutorial
* Move argument converters to separate rdoc
* Add references to argument_converters.rdoc
* Tune up argument converters
* Change explicit links to auto-links
c91ed8d33d
9 lines
265 B
Ruby
9 lines
265 B
Ruby
require 'optparse'
|
|
parser = OptionParser.new
|
|
parser.on('-x [XXX]', '--xxx', 'Optional argument via short name') do |value|
|
|
p ['--xxx', value]
|
|
end
|
|
parser.on('-y', '--yyy [YYY]', 'Optional argument via long name') do |value|
|
|
p ['--yyy', value]
|
|
end
|
|
parser.parse!
|