summaryrefslogtreecommitdiff
path: root/doc/ruby/long_names.rb
diff options
context:
space:
mode:
authorBurdetteLamar <burdettelamar@yahoo.com>2021-03-29 14:03:04 -0500
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-04-08 12:09:29 +0900
commit0d1d779c239c4e4d98c42a7e97a9f43e3c5e53ff (patch)
tree9d996d74a1c39f3e91dd21d8b2365afa46ea97f3 /doc/ruby/long_names.rb
parent956056db37c6d1ff0ba17746f81f83729c0fbb6b (diff)
[ruby/optparse] Beginnings of tutorial
https://github.com/ruby/optparse/commit/f209276f79
Diffstat (limited to 'doc/ruby/long_names.rb')
-rw-r--r--doc/ruby/long_names.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/ruby/long_names.rb b/doc/ruby/long_names.rb
new file mode 100644
index 0000000000..e36152d097
--- /dev/null
+++ b/doc/ruby/long_names.rb
@@ -0,0 +1,9 @@
+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!