summaryrefslogtreecommitdiff
path: root/doc/tutorial/short_names.rb
diff options
context:
space:
mode:
Diffstat (limited to 'doc/tutorial/short_names.rb')
-rw-r--r--doc/tutorial/short_names.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/tutorial/short_names.rb b/doc/tutorial/short_names.rb
new file mode 100644
index 0000000000..6581dfe19a
--- /dev/null
+++ b/doc/tutorial/short_names.rb
@@ -0,0 +1,9 @@
+require 'optparse'
+parser = OptionParser.new
+parser.on('-x') do |value|
+ p ['x', value]
+end
+parser.on('-1', '-%') do |value|
+ p ['-1 or -%', value]
+end
+parser.parse!