summaryrefslogtreecommitdiff
path: root/doc/ruby/optional_argument.rb
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ruby/optional_argument.rb')
-rw-r--r--doc/ruby/optional_argument.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/ruby/optional_argument.rb b/doc/ruby/optional_argument.rb
index ebff2f466d..456368a8ba 100644
--- a/doc/ruby/optional_argument.rb
+++ b/doc/ruby/optional_argument.rb
@@ -1,9 +1,9 @@
require 'optparse'
parser = OptionParser.new
-parser.on('-x [XXX]', '--xxx') do |value|
+parser.on('-x [XXX]', '--xxx', 'Optional argument via short name') do |value|
p ['--xxx', value]
end
-parser.on('-y', '--yyy [YYY]') do |value|
+parser.on('-y', '--yyy [YYY]', 'Optional argument via long name') do |value|
p ['--yyy', value]
end
parser.parse!