diff options
author | Burdette Lamar <[email protected]> | 2021-04-06 13:55:21 -0500 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2021-07-28 20:13:38 +0900 |
commit | 05e9efa323eb99727b099590c1d40d23f38443ef (patch) | |
tree | 77c1a3f76769200756afd0723f370c89a5415f27 /doc/tutorial/long_names.rb | |
parent | 8844eba4882e2a1627d26ea54a481b582640f739 (diff) |
[ruby/optparse] More on tutorial (https://github.com/ruby/optparse/pull/9)
* More on tutorial
* More on tutorial
* More on tutorial
* More on tutorial: clearer example output
https://github.com/ruby/optparse/commit/84dfd92d2a
Diffstat (limited to 'doc/tutorial/long_names.rb')
-rw-r--r-- | doc/tutorial/long_names.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/tutorial/long_names.rb b/doc/tutorial/long_names.rb new file mode 100644 index 0000000000..a34b3382c2 --- /dev/null +++ b/doc/tutorial/long_names.rb @@ -0,0 +1,9 @@ +require 'optparse' +parser = OptionParser.new +parser.on('--xxx') do |value| + p ['-xxx', value] +end +parser.on('--y1%', '--z2#') do |value| + p ['--y1% or --z2#', value] +end +parser.parse! |