From c795f30ef00e5d428b4ffaf95e91d61f4a26a505 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Fri, 9 Apr 2021 08:21:34 -0500 Subject: [PATCH] [ruby/optparse] Reorganize Ruby example files for sharing (#14) https://github.com/ruby/optparse/commit/9a2352c1c9 --- doc/creates_option.rdoc | 4 +- doc/{option_params => }/option_params.rdoc | 70 +++++++++---------- doc/option_params/mixed_names.rb | 12 ---- .../argument_keywords.rb | 0 .../argument_strings.rb | 0 doc/{tutorial => ruby}/argv.rb | 0 doc/{option_params => ruby}/array.rb | 0 doc/{option_params => ruby}/block.rb | 0 doc/{option_params => ruby}/date.rb | 0 doc/{option_params => ruby}/datetime.rb | 0 .../decimal_integer.rb | 0 .../decimal_numeric.rb | 0 doc/{option_params => ruby}/descriptions.rb | 0 .../explicit_array_values.rb | 0 .../explicit_hash_values.rb | 0 doc/{option_params => ruby}/false_class.rb | 0 doc/{option_params => ruby}/float.rb | 0 doc/{option_params => ruby}/integer.rb | 0 doc/{option_params => ruby}/long_binary.rb | 0 doc/{tutorial => ruby}/long_names.rb | 0 doc/{option_params => ruby}/long_optional.rb | 0 doc/{option_params => ruby}/long_required.rb | 0 doc/{option_params => ruby}/long_simple.rb | 0 doc/{option_params => ruby}/matched_values.rb | 0 doc/{option_params => ruby}/method.rb | 0 doc/{tutorial => ruby}/mixed_names.rb | 0 doc/{option_params => ruby}/numeric.rb | 0 doc/{option_params => ruby}/object.rb | 0 doc/{option_params => ruby}/octal_integer.rb | 0 doc/{tutorial => ruby}/optional_argument.rb | 0 doc/{option_params => ruby}/proc.rb | 0 doc/{option_params => ruby}/regexp.rb | 0 doc/{tutorial => ruby}/required_argument.rb | 0 doc/{option_params => ruby}/shellwords.rb | 0 doc/{tutorial => ruby}/short_names.rb | 0 doc/{option_params => ruby}/short_optional.rb | 0 doc/{option_params => ruby}/short_range.rb | 0 doc/{option_params => ruby}/short_required.rb | 0 doc/{option_params => ruby}/short_simple.rb | 0 doc/{option_params => ruby}/string.rb | 0 doc/{option_params => ruby}/terminator.rb | 0 doc/{option_params => ruby}/time.rb | 0 doc/{option_params => ruby}/true_class.rb | 0 doc/{option_params => ruby}/uri.rb | 0 doc/{tutorial => }/tutorial.rdoc | 12 ++-- 45 files changed, 43 insertions(+), 55 deletions(-) rename doc/{option_params => }/option_params.rdoc (95%) delete mode 100644 doc/option_params/mixed_names.rb rename doc/{option_params => ruby}/argument_keywords.rb (100%) rename doc/{option_params => ruby}/argument_strings.rb (100%) rename doc/{tutorial => ruby}/argv.rb (100%) rename doc/{option_params => ruby}/array.rb (100%) rename doc/{option_params => ruby}/block.rb (100%) rename doc/{option_params => ruby}/date.rb (100%) rename doc/{option_params => ruby}/datetime.rb (100%) rename doc/{option_params => ruby}/decimal_integer.rb (100%) rename doc/{option_params => ruby}/decimal_numeric.rb (100%) rename doc/{option_params => ruby}/descriptions.rb (100%) rename doc/{option_params => ruby}/explicit_array_values.rb (100%) rename doc/{option_params => ruby}/explicit_hash_values.rb (100%) rename doc/{option_params => ruby}/false_class.rb (100%) rename doc/{option_params => ruby}/float.rb (100%) rename doc/{option_params => ruby}/integer.rb (100%) rename doc/{option_params => ruby}/long_binary.rb (100%) rename doc/{tutorial => ruby}/long_names.rb (100%) rename doc/{option_params => ruby}/long_optional.rb (100%) rename doc/{option_params => ruby}/long_required.rb (100%) rename doc/{option_params => ruby}/long_simple.rb (100%) rename doc/{option_params => ruby}/matched_values.rb (100%) rename doc/{option_params => ruby}/method.rb (100%) rename doc/{tutorial => ruby}/mixed_names.rb (100%) rename doc/{option_params => ruby}/numeric.rb (100%) rename doc/{option_params => ruby}/object.rb (100%) rename doc/{option_params => ruby}/octal_integer.rb (100%) rename doc/{tutorial => ruby}/optional_argument.rb (100%) rename doc/{option_params => ruby}/proc.rb (100%) rename doc/{option_params => ruby}/regexp.rb (100%) rename doc/{tutorial => ruby}/required_argument.rb (100%) rename doc/{option_params => ruby}/shellwords.rb (100%) rename doc/{tutorial => ruby}/short_names.rb (100%) rename doc/{option_params => ruby}/short_optional.rb (100%) rename doc/{option_params => ruby}/short_range.rb (100%) rename doc/{option_params => ruby}/short_required.rb (100%) rename doc/{option_params => ruby}/short_simple.rb (100%) rename doc/{option_params => ruby}/string.rb (100%) rename doc/{option_params => ruby}/terminator.rb (100%) rename doc/{option_params => ruby}/time.rb (100%) rename doc/{option_params => ruby}/true_class.rb (100%) rename doc/{option_params => ruby}/uri.rb (100%) rename doc/{tutorial => }/tutorial.rdoc (96%) diff --git a/doc/creates_option.rdoc b/doc/creates_option.rdoc index d006706382..af1ac16f2b 100644 --- a/doc/creates_option.rdoc +++ b/doc/creates_option.rdoc @@ -1,7 +1,7 @@ Creates an option from the given parameters +params+. -See {Parameters for New Options}[doc/option_params/option_params_rdoc.html]. +See {Parameters for New Options}[doc/option_params_rdoc.html]. The block, if given, is the handler for the created option. When the option is encountered during command-line parsing, the block is called with the argument given for the option, if any. -See {Option Handlers}[doc/option_params/option_params_rdoc.html#label-Option+Handlers]. +See {Option Handlers}[doc/option_params_rdoc.html#label-Option+Handlers]. diff --git a/doc/option_params/option_params.rdoc b/doc/option_params.rdoc similarity index 95% rename from doc/option_params/option_params.rdoc rename to doc/option_params.rdoc index ebd08f1fa6..98d9630a38 100644 --- a/doc/option_params/option_params.rdoc +++ b/doc/option_params.rdoc @@ -77,7 +77,7 @@ File +short_simple.rb+ defines two options: - One with short name -x. - The other with two short names, in effect, aliases, -1 and -%. - :include: short_simple.rb + :include: ruby/short_simple.rb Executions: @@ -100,7 +100,7 @@ defines an option that requires an argument. File +short_required.rb+ defines an option -x that requires an argument. - :include: short_required.rb + :include: ruby/short_required.rb Executions: @@ -120,7 +120,7 @@ defines an option that allows an optional argument. File +short_optional.rb+ defines an option -x that allows an optional argument. - :include: short_optional.rb + :include: ruby/short_optional.rb Executions: @@ -141,7 +141,7 @@ The parser yields both the actual character cited and the value. File +short_range.rb+ defines an option with short names for all printable characters from ! to ~: - :include: short_range.rb + :include: ruby/short_range.rb Executions: @@ -167,7 +167,7 @@ File +long_simple.rb+ defines two options: - The other with two long names, in effect, aliases, --y1% and --z2#. - :include: long_simple.rb + :include: ruby/long_simple.rb Executions: @@ -190,7 +190,7 @@ defines an option that requires an argument. File +long_required.rb+ defines an option --xxx that requires an argument. - :include: long_required.rb + :include: ruby/long_required.rb Executions: @@ -210,7 +210,7 @@ defines an option that allows an optional argument. File +long_optional.rb+ defines an option --xxx that allows an optional argument. - :include: long_optional.rb + :include: ruby/long_optional.rb Executions: @@ -228,7 +228,7 @@ An option may have both short and long names. File +mixed_names.rb+ defines a mixture of short and long names. - :include: mixed_names.rb + :include: ruby/mixed_names.rb Executions: @@ -272,7 +272,7 @@ which is one of :NONE (the default), File +argument_keywords.rb+ defines an option with a required argument. - :include: argument_keywords.rb + :include: ruby/argument_keywords.rb Executions: @@ -291,7 +291,7 @@ is to define it in a string separate from the name string. File +argument_strings.rb+ defines an option with a required argument. - :include: argument_strings.rb + :include: ruby/argument_strings.rb Executions: @@ -323,7 +323,7 @@ The argument value must be one of those strings. File +explicit_array_values.rb+ defines options with explicit argument values. - :include: explicit_array_values.rb + :include: ruby/explicit_array_values.rb Executions: @@ -349,7 +349,7 @@ and the value yielded will be the value for that key. File +explicit_hash_values.rb+ defines options with explicit argument values. - :include: explicit_hash_values.rb + :include: ruby/explicit_hash_values.rb Executions: @@ -381,7 +381,7 @@ by specifying a Regexp that the given argument must match. File +matched_values.rb+ defines options with matched argument values. - :include: matched_values.rb + :include: ruby/matched_values.rb Executions: @@ -410,7 +410,7 @@ defines an option whose argument is to be converted to a \Date object. The argument is converted by method {Date.parse}[https://ruby-doc.org/stdlib/libdoc/date/rdoc/Date.html#method-c-parse]. - :include: date.rb + :include: ruby/date.rb Executions: @@ -428,7 +428,7 @@ defines an option whose argument is to be converted to a \DateTime object. The argument is converted by method {DateTime.parse}[https://ruby-doc.org/stdlib-2.6.1/libdoc/date/rdoc/DateTime.html#method-c-parse]. - :include: datetime.rb + :include: ruby/datetime.rb Executions: @@ -447,7 +447,7 @@ The argument is converted by method {Time.httpdate}[https://ruby-doc.org/stdlib-2.7.0/libdoc/time/rdoc/Time.html#method-c-httpdate] or {Time.parse}[https://ruby-doc.org/stdlib-2.7.0/libdoc/time/rdoc/Time.html#method-c-parse]. - :include: time.rb + :include: ruby/time.rb Executions: @@ -463,7 +463,7 @@ defines an option whose argument is to be converted to a \URI object. The argument is converted by method {URI.parse}[https://ruby-doc.org/stdlib-2.7.2/libdoc/uri/rdoc/URI.html#method-c-parse]. - :include: uri.rb + :include: ruby/uri.rb Executions: @@ -480,7 +480,7 @@ File +shellwords.rb+ defines an option whose argument is to be converted to an \Array object by method {Shellwords.shellwords}[https://ruby-doc.org/stdlib-2.7.0/libdoc/shellwords/rdoc/Shellwords.html#method-c-shellwords]. - :include: shellwords.rb + :include: ruby/shellwords.rb Executions: @@ -496,7 +496,7 @@ defines an option whose argument is to be converted to an \Integer object. The argument is converted by method {Kernel.Integer}[https://ruby-doc.org/core/Kernel.html#method-i-Integer]. - :include: integer.rb + :include: ruby/integer.rb Executions: @@ -518,7 +518,7 @@ defines an option whose argument is to be converted to a \Float object. The argument is converted by method {Kernel.Float}[https://ruby-doc.org/core/Kernel.html#method-i-Float]. - :include: float.rb + :include: ruby/float.rb Executions: @@ -541,7 +541,7 @@ The argument is converted by method {Kernel.Float}[https://ruby-doc.org/core/Kernel.html#method-i-Float], or {Kernel.Integer}[https://ruby-doc.org/core/Kernel.html#method-i-Integer]. - :include: numeric.rb + :include: ruby/numeric.rb Executions: @@ -559,7 +559,7 @@ defines an option whose argument is to be converted to an \Integer object. The argument is converted by method {Kernel.Integer}[https://ruby-doc.org/core/Kernel.html#method-i-Integer]. - :include: decimal_integer.rb + :include: ruby/decimal_integer.rb The argument may not be in a binary or hexadecimal format; a leading zero is ignored (not parsed as octal). @@ -582,7 +582,7 @@ defines an option whose argument is to be converted to an \Integer object. The argument is converted by method {Kernel.Integer}[https://ruby-doc.org/core/Kernel.html#method-i-Integer]. - :include: octal_integer.rb + :include: ruby/octal_integer.rb The argument may not be in a binary or hexadecimal format; it is parsed as octal, regardless of whether it has a leading zero. @@ -603,7 +603,7 @@ defines an option whose argument is to be converted to an \Integer object. The argument is converted by method {Kernel.Integer}[https://ruby-doc.org/core/Kernel.html#method-i-Integer]. - :include: decimal_numeric.rb + :include: ruby/decimal_numeric.rb The argument may not be in a binary or hexadecimal format; a leading zero causes the argument to be parsed as octal. @@ -624,7 +624,7 @@ defines an option whose argument is to be converted to +true+ or +false+. The argument is evaluated by method {Object#nil?}[https://ruby-doc.org/core-3.0.0/Object.html#method-i-nil-3F]. - :include: true_class.rb + :include: ruby/true_class.rb The argument may be any of those shown in the examples below. @@ -652,7 +652,7 @@ defines an option whose argument is to be converted to +true+ or +false+. The argument is evaluated by method {Object#nil?}[https://ruby-doc.org/core-3.0.0/Object.html#method-i-nil-3F]. - :include: false_class.rb + :include: ruby/false_class.rb The argument may be any of those shown in the examples below. @@ -678,7 +678,7 @@ Executions: File +object.rb+ defines an option whose argument is not to be converted from \String. - :include: object.rb + :include: ruby/object.rb Executions: @@ -692,7 +692,7 @@ Executions: File +string.rb+ defines an option whose argument is not to be converted from \String. - :include: string.rb + :include: ruby/string.rb Executions: @@ -707,7 +707,7 @@ File +array.rb+ defines an option whose argument is to be converted from \String to an array of strings, based on comma-separated substrings. - :include: array.rb + :include: ruby/array.rb Executions: @@ -723,7 +723,7 @@ Executions: File +regexp.rb+ defines an option whose argument is to be converted to a \Regexp object. - :include: regexp.rb + :include: ruby/regexp.rb Executions: @@ -744,7 +744,7 @@ File +descriptions.rb+ has six strings in its array +descriptions+. These are all passed as parameters to OptionParser#on, so that they all, line for line, become the option's description. - :include: descriptions.rb + :include: ruby/descriptions.rb Executions: @@ -774,7 +774,7 @@ An option hadler may be a block. File +block.rb+ defines an option that has a handler block. - :include: block.rb + :include: ruby/block.rb Executions: @@ -793,7 +793,7 @@ An option handler may be a Proc. File +proc.rb+ defines an option that has a handler proc. - :include: proc.rb + :include: ruby/proc.rb Executions: @@ -812,7 +812,7 @@ An option handler may be a Method. File +proc.rb+ defines an option that has a handler method. - :include: method.rb + :include: ruby/method.rb Executions: @@ -833,7 +833,7 @@ This can be useful if there are options not meant for the current program. File +terminator.rb+ defines one option --my_option. - :include: terminator.rb + :include: ruby/terminator.rb The first execution fails because --nosuch is not a defined option; the second succeeds because -- causes that option to be ignored: diff --git a/doc/option_params/mixed_names.rb b/doc/option_params/mixed_names.rb deleted file mode 100644 index fe6c554bdc..0000000000 --- a/doc/option_params/mixed_names.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'optparse' -parser = OptionParser.new -parser.on('-x', '--xxx', 'Short and long, simple') do |value| - p ['--xxx', value] -end -parser.on('-yYYY', '--yyy', 'Short and long, required argument') do |value| - p ['--yyy', value] -end -parser.on('-z [ZZZ]', '--zzz', 'Short and long, optional argument') do |value| - p ['--zzz', value] -end -parser.parse! diff --git a/doc/option_params/argument_keywords.rb b/doc/ruby/argument_keywords.rb similarity index 100% rename from doc/option_params/argument_keywords.rb rename to doc/ruby/argument_keywords.rb diff --git a/doc/option_params/argument_strings.rb b/doc/ruby/argument_strings.rb similarity index 100% rename from doc/option_params/argument_strings.rb rename to doc/ruby/argument_strings.rb diff --git a/doc/tutorial/argv.rb b/doc/ruby/argv.rb similarity index 100% rename from doc/tutorial/argv.rb rename to doc/ruby/argv.rb diff --git a/doc/option_params/array.rb b/doc/ruby/array.rb similarity index 100% rename from doc/option_params/array.rb rename to doc/ruby/array.rb diff --git a/doc/option_params/block.rb b/doc/ruby/block.rb similarity index 100% rename from doc/option_params/block.rb rename to doc/ruby/block.rb diff --git a/doc/option_params/date.rb b/doc/ruby/date.rb similarity index 100% rename from doc/option_params/date.rb rename to doc/ruby/date.rb diff --git a/doc/option_params/datetime.rb b/doc/ruby/datetime.rb similarity index 100% rename from doc/option_params/datetime.rb rename to doc/ruby/datetime.rb diff --git a/doc/option_params/decimal_integer.rb b/doc/ruby/decimal_integer.rb similarity index 100% rename from doc/option_params/decimal_integer.rb rename to doc/ruby/decimal_integer.rb diff --git a/doc/option_params/decimal_numeric.rb b/doc/ruby/decimal_numeric.rb similarity index 100% rename from doc/option_params/decimal_numeric.rb rename to doc/ruby/decimal_numeric.rb diff --git a/doc/option_params/descriptions.rb b/doc/ruby/descriptions.rb similarity index 100% rename from doc/option_params/descriptions.rb rename to doc/ruby/descriptions.rb diff --git a/doc/option_params/explicit_array_values.rb b/doc/ruby/explicit_array_values.rb similarity index 100% rename from doc/option_params/explicit_array_values.rb rename to doc/ruby/explicit_array_values.rb diff --git a/doc/option_params/explicit_hash_values.rb b/doc/ruby/explicit_hash_values.rb similarity index 100% rename from doc/option_params/explicit_hash_values.rb rename to doc/ruby/explicit_hash_values.rb diff --git a/doc/option_params/false_class.rb b/doc/ruby/false_class.rb similarity index 100% rename from doc/option_params/false_class.rb rename to doc/ruby/false_class.rb diff --git a/doc/option_params/float.rb b/doc/ruby/float.rb similarity index 100% rename from doc/option_params/float.rb rename to doc/ruby/float.rb diff --git a/doc/option_params/integer.rb b/doc/ruby/integer.rb similarity index 100% rename from doc/option_params/integer.rb rename to doc/ruby/integer.rb diff --git a/doc/option_params/long_binary.rb b/doc/ruby/long_binary.rb similarity index 100% rename from doc/option_params/long_binary.rb rename to doc/ruby/long_binary.rb diff --git a/doc/tutorial/long_names.rb b/doc/ruby/long_names.rb similarity index 100% rename from doc/tutorial/long_names.rb rename to doc/ruby/long_names.rb diff --git a/doc/option_params/long_optional.rb b/doc/ruby/long_optional.rb similarity index 100% rename from doc/option_params/long_optional.rb rename to doc/ruby/long_optional.rb diff --git a/doc/option_params/long_required.rb b/doc/ruby/long_required.rb similarity index 100% rename from doc/option_params/long_required.rb rename to doc/ruby/long_required.rb diff --git a/doc/option_params/long_simple.rb b/doc/ruby/long_simple.rb similarity index 100% rename from doc/option_params/long_simple.rb rename to doc/ruby/long_simple.rb diff --git a/doc/option_params/matched_values.rb b/doc/ruby/matched_values.rb similarity index 100% rename from doc/option_params/matched_values.rb rename to doc/ruby/matched_values.rb diff --git a/doc/option_params/method.rb b/doc/ruby/method.rb similarity index 100% rename from doc/option_params/method.rb rename to doc/ruby/method.rb diff --git a/doc/tutorial/mixed_names.rb b/doc/ruby/mixed_names.rb similarity index 100% rename from doc/tutorial/mixed_names.rb rename to doc/ruby/mixed_names.rb diff --git a/doc/option_params/numeric.rb b/doc/ruby/numeric.rb similarity index 100% rename from doc/option_params/numeric.rb rename to doc/ruby/numeric.rb diff --git a/doc/option_params/object.rb b/doc/ruby/object.rb similarity index 100% rename from doc/option_params/object.rb rename to doc/ruby/object.rb diff --git a/doc/option_params/octal_integer.rb b/doc/ruby/octal_integer.rb similarity index 100% rename from doc/option_params/octal_integer.rb rename to doc/ruby/octal_integer.rb diff --git a/doc/tutorial/optional_argument.rb b/doc/ruby/optional_argument.rb similarity index 100% rename from doc/tutorial/optional_argument.rb rename to doc/ruby/optional_argument.rb diff --git a/doc/option_params/proc.rb b/doc/ruby/proc.rb similarity index 100% rename from doc/option_params/proc.rb rename to doc/ruby/proc.rb diff --git a/doc/option_params/regexp.rb b/doc/ruby/regexp.rb similarity index 100% rename from doc/option_params/regexp.rb rename to doc/ruby/regexp.rb diff --git a/doc/tutorial/required_argument.rb b/doc/ruby/required_argument.rb similarity index 100% rename from doc/tutorial/required_argument.rb rename to doc/ruby/required_argument.rb diff --git a/doc/option_params/shellwords.rb b/doc/ruby/shellwords.rb similarity index 100% rename from doc/option_params/shellwords.rb rename to doc/ruby/shellwords.rb diff --git a/doc/tutorial/short_names.rb b/doc/ruby/short_names.rb similarity index 100% rename from doc/tutorial/short_names.rb rename to doc/ruby/short_names.rb diff --git a/doc/option_params/short_optional.rb b/doc/ruby/short_optional.rb similarity index 100% rename from doc/option_params/short_optional.rb rename to doc/ruby/short_optional.rb diff --git a/doc/option_params/short_range.rb b/doc/ruby/short_range.rb similarity index 100% rename from doc/option_params/short_range.rb rename to doc/ruby/short_range.rb diff --git a/doc/option_params/short_required.rb b/doc/ruby/short_required.rb similarity index 100% rename from doc/option_params/short_required.rb rename to doc/ruby/short_required.rb diff --git a/doc/option_params/short_simple.rb b/doc/ruby/short_simple.rb similarity index 100% rename from doc/option_params/short_simple.rb rename to doc/ruby/short_simple.rb diff --git a/doc/option_params/string.rb b/doc/ruby/string.rb similarity index 100% rename from doc/option_params/string.rb rename to doc/ruby/string.rb diff --git a/doc/option_params/terminator.rb b/doc/ruby/terminator.rb similarity index 100% rename from doc/option_params/terminator.rb rename to doc/ruby/terminator.rb diff --git a/doc/option_params/time.rb b/doc/ruby/time.rb similarity index 100% rename from doc/option_params/time.rb rename to doc/ruby/time.rb diff --git a/doc/option_params/true_class.rb b/doc/ruby/true_class.rb similarity index 100% rename from doc/option_params/true_class.rb rename to doc/ruby/true_class.rb diff --git a/doc/option_params/uri.rb b/doc/ruby/uri.rb similarity index 100% rename from doc/option_params/uri.rb rename to doc/ruby/uri.rb diff --git a/doc/tutorial/tutorial.rdoc b/doc/tutorial.rdoc similarity index 96% rename from doc/tutorial/tutorial.rdoc rename to doc/tutorial.rdoc index 60ead0a6c6..5e95f20fae 100644 --- a/doc/tutorial/tutorial.rdoc +++ b/doc/tutorial.rdoc @@ -6,7 +6,7 @@ When a Ruby program executes, it captures its command-line arguments and options into variable ARGV. This simple program just prints its \ARGV: - :include: argv.rb + :include: ruby/argv.rb Execution, with arguments and options: @@ -67,7 +67,7 @@ File +short_names.rb+ defines an option with a short name, -x, and an option with two short names (aliases, in effect) -y and -z. - :include: short_names.rb + :include: ruby/short_names.rb Executions: @@ -99,7 +99,7 @@ File +long_names.rb+ defines an option with a long name, --xxx, and an option with two long names (aliases, in effect) --y1% and --z2#. - :include: long_names.rb + :include: ruby/long_names.rb Executions: @@ -118,7 +118,7 @@ so that a short name is in effect an abbreviation of a long name. File +mixed_names.rb+ defines options that each have both a short and a long name. - :include: mixed_names.rb + :include: ruby/mixed_names.rb Executions: @@ -147,7 +147,7 @@ to its name definition. File +required_argument.rb+ defines two options; each has a required argument because the name definition has a following dummy word. - :include: required_argument.rb + :include: ruby/required_argument.rb When an option is found, the given argument is yielded. @@ -172,7 +172,7 @@ File +optional_argument.rb+ defines two options; each has an optional argument because the name definition has a following dummy word in square brackets. - :include: optional_argument.rb + :include: ruby/optional_argument.rb When an option with an argument is found, the given argument yielded.