diff options
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! |