diff options
author | BurdetteLamar <burdettelamar@yahoo.com> | 2021-03-29 14:03:04 -0500 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-04-08 12:09:29 +0900 |
commit | 0d1d779c239c4e4d98c42a7e97a9f43e3c5e53ff (patch) | |
tree | 9d996d74a1c39f3e91dd21d8b2365afa46ea97f3 /doc/ruby/short_names.rb | |
parent | 956056db37c6d1ff0ba17746f81f83729c0fbb6b (diff) |
[ruby/optparse] Beginnings of tutorial
https://github.com/ruby/optparse/commit/f209276f79
Diffstat (limited to 'doc/ruby/short_names.rb')
-rw-r--r-- | doc/ruby/short_names.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/ruby/short_names.rb b/doc/ruby/short_names.rb new file mode 100644 index 0000000000..0dc35b789b --- /dev/null +++ b/doc/ruby/short_names.rb @@ -0,0 +1,9 @@ +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! |