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
195 B
Ruby
9 lines
195 B
Ruby
require 'optparse/date'
|
|
parser = OptionParser.new
|
|
parser.accept(Complex) do |value|
|
|
value.to_c
|
|
end
|
|
parser.on('--complex COMPLEX', Complex) do |value|
|
|
p [value, value.class]
|
|
end
|
|
parser.parse!
|