mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 06:25:31 +02:00
[ruby/optparse] [DOC] Add missing secition
Fixes https://github.com/ruby/optparse/pull/51
667ab35f59
This commit is contained in:
parent
df941aa90d
commit
af4e839c47
2 changed files with 32 additions and 0 deletions
9
doc/optparse/ruby/argument_abbreviation.rb
Normal file
9
doc/optparse/ruby/argument_abbreviation.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
require 'optparse'
|
||||
parser = OptionParser.new
|
||||
parser.on('-x', '--xxx=VALUE', %w[ABC def], 'Argument abbreviations') do |value|
|
||||
p ['--xxx', value]
|
||||
end
|
||||
parser.on('-y', '--yyy=VALUE', {"abc"=>"XYZ", def: "FOO"}, 'Argument abbreviations') do |value|
|
||||
p ['--yyy', value]
|
||||
end
|
||||
parser.parse!
|
Loading…
Add table
Add a link
Reference in a new issue