ruby-changes:66950
From: Nobuyoshi <ko1@a...>
Date: Wed, 28 Jul 2021 20:14:37 +0900 (JST)
Subject: [ruby-changes:66950] a10db32003 (master): [ruby/optparse] Removed a duplicate section
https://git.ruby-lang.org/ruby.git/commit/?id=a10db32003 From a10db32003320a81c32a3733d9d97ba6e3614efa Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 16 Apr 2021 12:57:55 +0900 Subject: [ruby/optparse] Removed a duplicate section https://github.com/ruby/optparse/commit/7ef3d89e78 --- doc/optparse/tutorial.rdoc | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/doc/optparse/tutorial.rdoc b/doc/optparse/tutorial.rdoc index dfdc244..8b17726 100644 --- a/doc/optparse/tutorial.rdoc +++ b/doc/optparse/tutorial.rdoc @@ -94,42 +94,6 @@ Executions: https://github.com/ruby/ruby/blob/trunk/doc/optparse/tutorial.rdoc#L94 ["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 - ["x", true] - ["z", true] - $ ruby basic.rb -z -y -x - ["z", true] - ["y", true] - ["x", true] - === Defining Options A common way to define an option in \OptionParser -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/