diff options
Diffstat (limited to 'doc/ruby/short_simple.rb')
-rw-r--r-- | doc/ruby/short_simple.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/ruby/short_simple.rb b/doc/ruby/short_simple.rb new file mode 100644 index 0000000000..d3d489e2dc --- /dev/null +++ b/doc/ruby/short_simple.rb @@ -0,0 +1,9 @@ +require 'optparse' +parser = OptionParser.new +parser.on('-x', 'One short name') do |value| + p ['-x', value] +end +parser.on('-1', '-%', 'Two short names (aliases)') do |value| + p ['-1 or -%', value] +end +parser.parse! |