mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 20:44:00 +02:00
[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
This commit is contained in:
parent
8844eba488
commit
05e9efa323
10 changed files with 133 additions and 54 deletions
9
doc/tutorial/required_argument.rb
Normal file
9
doc/tutorial/required_argument.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
require 'optparse'
|
||||
parser = OptionParser.new
|
||||
parser.on('-x XXX', '--xxx') do |value|
|
||||
p ['--xxx', value]
|
||||
end
|
||||
parser.on('-y', '--y YYY') do |value|
|
||||
p ['--yyy', value]
|
||||
end
|
||||
parser.parse!
|
Loading…
Add table
Add a link
Reference in a new issue