mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/optparse] More on tutorial (#9)
* More on tutorial: clearer example output
84dfd92d2a
This commit is contained in:
parent
2b66b22479
commit
fe72cff487
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