1
0
Fork 0
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:
Burdette Lamar 2021-04-06 13:55:21 -05:00 committed by Nobuyoshi Nakada
parent 2b66b22479
commit fe72cff487
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
10 changed files with 133 additions and 54 deletions

View file

@ -1,2 +0,0 @@
p ARGV

View file

@ -1,9 +0,0 @@
require 'optparse'
parser = OptionParser.new
parser.on('--xxx') do |option|
p "--xxx #{option}"
end
parser.on('--y1%', '--z2#') do |option|
p "--y1% or --z2# #{option}"
end
parser.parse!

View file

@ -1,9 +0,0 @@
require 'optparse'
parser = OptionParser.new
parser.on('-x', '--xxx') do |option|
p "--xxx #{option}"
end
parser.on('-y', '--y1%') do |option|
p "--y1% #{option}"
end
parser.parse!

View file

@ -1,9 +0,0 @@
require 'optparse'
parser = OptionParser.new
parser.on('-x') do |option|
p "-x #{option}"
end
parser.on('-1', '-%') do |option|
p "-1 or -% #{option}"
end
parser.parse!