avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosu...@apache.org
Subject cvs commit: avalon-excalibur/compatibility/src/java/org/apache/avalon/excalibur/cli package.html
Date Fri, 11 Apr 2003 12:26:08 GMT
leosutic    2003/04/11 05:26:08

  Modified:    compatibility/src/java/org/apache/avalon/excalibur/cli
  Merging relevant portions of the old docs (that got lost in the shuffle).
  Revision  Changes    Path
  1.3       +45 -2     avalon-excalibur/compatibility/src/java/org/apache/avalon/excalibur/cli/package.html
  Index: package.html
  RCS file: /home/cvs/avalon-excalibur/compatibility/src/java/org/apache/avalon/excalibur/cli/package.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- package.html	23 Mar 2003 11:20:18 -0000	1.2
  +++ package.html	11 Apr 2003 12:26:08 -0000	1.3
  @@ -5,9 +5,9 @@
       <body bgcolor="white">
           Utility code for parsing command-line options.
  -<p><strong>These classes have all been deprecated in favor of
  +<p style="font-weight:bold">These classes have all been deprecated in favor of
   the <a href="http://jakarta.apache.org/commons/">Jakarta Commons</a>
  -version of the CLI classes.</strong></p>
  +version of the CLI classes.</p>
           <p>The utilities in <code>org.apache.avalon.excalibur.cli</code>
  @@ -114,6 +114,49 @@
  +        <h3>Parsing Rules</h3>
  +                <p>
  +                The command line is parsed according to the following rules. There are
  +                two forms of options in this package, the Long form and the Short form.
  +                The long form of an option is preceded by the '--' characters while the
  +                short form is preceded by a single '-'. Some example options would be;
  +                "--an-option", "-a", "--day", "-s -f -a".
  +                </p>
  +                <p>
  +                In the tradition of UNIX programs, the short form of an option can occur
  +                immediately after another short form option. So if 'a', 'b' and 'c' are
  +                short forms of options that take no parameters then the following
  +                command lines are equivalent: "-abc", "-a -bc", "-a -b -c", "-ab -c", etc.
  +                </p>
  +                <p>
  +                Options can also accept arguments if specified. You can specify that an
  +                option requires an argument in which the text immediately following the
  +                option will be considered to be an argument to the option. So if 'a' was
  +                option that required an argument then the following would be equivalent;
  +                "-abc", "-a bc" (namely the option 'a' with argument 'bc').
  +                </p>
  +                <p>
  +                Options can also specify optional arguments. In this case if there is any
  +                text immediately following the option character then it is considered an
  +                argument.  Otherwise, the option has no arguments. For example if 'a' was
  +                option that required an optional argument then "-abc" is an option 'a'
  +                argument "bc" while "-a bc" is an option 'a' with no argument, followed
  +                the text "bc". </p>
  +                <p>It is also possible to place an '=' sign between the option
  +                and it's argument. So if we assume that a is an option that 
  +                requires an argument then the following are all equivalent; 
  +                "-a=bc", "-a bc" "-abc".
  +                </p>
  +                <p>
  +                In some cases it is also necessary to disable command line parsing so that
  +                can pass a text argument to the program that starts with a '-' character.
To do
  +                this insert the sequence '--' onto the command line with no text immediately
  +                following it. This will disable processing for the rest of the command
  +                The '--' characters will not be passed to the user program. For instance
  +                line "-- -b" would result in the program being passed the
  +                text "-b" (ie. not as an option).
  +                </p>
   @since 4.0

To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org

View raw message