diff options
author | Burdette Lamar <[email protected]> | 2021-04-06 13:55:21 -0500 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-04-08 12:11:32 +0900 |
commit | fe72cff487283dbaadb9757e74f00291d772cb6f (patch) | |
tree | 17f23b59af67fee6f73a42c6e49c209343ba3152 /doc/tutorial/required_argument.rb | |
parent | 2b66b224793915adb8ed27308e9db26fc273635b (diff) |
[ruby/optparse] More on tutorial (#9)
* More on tutorial: clearer example output
https://github.com/ruby/optparse/commit/84dfd92d2a
Diffstat (limited to 'doc/tutorial/required_argument.rb')
-rw-r--r-- | doc/tutorial/required_argument.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/tutorial/required_argument.rb b/doc/tutorial/required_argument.rb new file mode 100644 index 0000000000..7a5a868265 --- /dev/null +++ b/doc/tutorial/required_argument.rb @@ -0,0 +1,9 @@ +require 'optparse' +parser = OptionParser.new +parser.on('-x XXX', '--xxx') do |value| + p ['--xxx', value] +end +parser.on('-y', '--y YYY') do |value| + p ['--yyy', value] +end +parser.parse! |