summaryrefslogtreecommitdiff
path: root/doc/ruby/required_argument.rb
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2021-04-10 10:05:44 -0500
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-04-11 08:52:52 +0900
commitff0dac184902e42fac148940cd6c026679a0ee21 (patch)
tree2c4272338a5d5c96629c07180a54dc72807cba7b /doc/ruby/required_argument.rb
parentc795f30ef00e5d428b4ffaf95e91d61f4a26a505 (diff)
[ruby/optparse] Rdoc (#15)
* Resolve shared mixed_names.rb * Add long option with negation * Show --help for all examples * Table of contents for tutorial * Move argument converters to separate rdoc * Add references to argument_converters.rdoc * Tune up argument converters * Change explicit links to auto-links https://github.com/ruby/optparse/commit/c91ed8d33d
Diffstat (limited to 'doc/ruby/required_argument.rb')
-rw-r--r--doc/ruby/required_argument.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/ruby/required_argument.rb b/doc/ruby/required_argument.rb
index 7a5a868265..228a492c3c 100644
--- a/doc/ruby/required_argument.rb
+++ b/doc/ruby/required_argument.rb
@@ -1,9 +1,9 @@
require 'optparse'
parser = OptionParser.new
-parser.on('-x XXX', '--xxx') do |value|
+parser.on('-x XXX', '--xxx', 'Required argument via short name') do |value|
p ['--xxx', value]
end
-parser.on('-y', '--y YYY') do |value|
+parser.on('-y', '--y YYY', 'Required argument via long name') do |value|
p ['--yyy', value]
end
parser.parse!