Skip to content

Commit

Permalink
Removed a duplicate section
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Apr 16, 2021
1 parent 9c5b3f2 commit 7ef3d89
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions doc/optparse/tutorial.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,42 +84,6 @@ From these defined options, the parser automatically builds help text:
When an option is found during parsing,
the block defined for the option is called with the argument value.

Executions:

$ ruby basic.rb -x -z
["x", true]
["z", true]
$ ruby basic.rb -z -y -x
["z", true]
["y", true]
["x", true]

=== To Begin With

To use \OptionParser:

1. Require the \OptionParser code.
2. Create an \OptionParser object.
3. Define one or more options.
4. Parse the command line.

File +basic.rb+ defines three options, <tt>-x</tt>,
<tt>-y</tt>, and <tt>-z</tt>, each with a descriptive string,
and each with a block.

:include: ruby/basic.rb

From these defined options, the parser automatically builds help text:

$ ruby basic.rb --help
Usage: basic [options]
-x Whether to X
-y Whether to Y
-z Whether to Z

When an option is found during parsing,
the block defined for the option is called with the argument value.

Executions:

$ ruby basic.rb -x -z
Expand Down

0 comments on commit 7ef3d89

Please sign in to comment.