commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jke...@apache.org
Subject cvs commit: jakarta-commons/cli/xdocs introduction.xml navigation.xml
Date Mon, 24 Jun 2002 20:38:27 GMT
jkeyes      2002/06/24 13:38:26

  Modified:    cli/xdocs navigation.xml
  Added:       cli/xdocs introduction.xml
  Log:
  added introduction
  
  Revision  Changes    Path
  1.2       +3 -2      jakarta-commons/cli/xdocs/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/xdocs/navigation.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- navigation.xml	10 Jun 2002 18:20:39 -0000	1.1
  +++ navigation.xml	24 Jun 2002 20:38:26 -0000	1.2
  @@ -4,8 +4,9 @@
     <title>CLI</title>
   
     <body>
  -    <menu name="Examples">
  -      <item name="Simple Option"                   href="/usage.html"/>
  +    <menu name="User Documentation">
  +      <item name="Command Line Processing"  href="/introduction.html"/>
  +      <item name="Simple Option"            href="/usage.html"/>
       </menu>
     </body>
   </project>
  
  
  
  1.1                  jakarta-commons/cli/xdocs/introduction.xml
  
  Index: introduction.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
  
    <properties>
      <author email="jbjk@mac.com">John Keyes</author>
      <title>Introduction</title>
    </properties>
  
    <body>
      <section name="Introduction">
        <p>
          There are three stages to command line processing.  They are the
          definition, parsing and interrogation stages.  The following 
          sections will discuss each of these stages in turn, and discuss how
          to implement them with CLI.
        </p>
      </section>
      <section name="Definition Stage">
        <p>
          Each command line must define the set of options that will be used 
          to define the interface to the application.
        </p>
        <p>
          CLI uses the <a href="apidocs/org/apache/commons/cli/Options.html">
          <code>Options</code></a> class, as a container for 
          <a href="apidocs/org/apache/commons/cli/Options.html">
          <code>Option</code></a> instances.  There are two ways to create
          <code>Option</code>s in CLI.  One of them is via the constuctors,
          the other way is via the factory methods defined in 
          <code>Options</code>.
        </p>
        <p>
          The <a href="usage.html">Simple Option</a> document provides examples
          how to create an <code>Options</code> object.
        </p>
        <p>
          The result of the definition stage is an <code>Options</code> 
          instance.
        </p>
      </section>
      <section name="Parsing Stage">
        <p>
          The parsing stage is where the text passed into the 
          application via the command line is processed.  The text is 
          processed according to the rules defined by the parser 
          implementation.
        </p>
        <p>
          The <code>parse</code> method defined on 
          <a href="apidocs/org/apache/commons/cli/CommandLineParser.html">
          <code>CommandLineParser</code></a> takes an <code>Options</code>
          instance and a <code>java.util.List</code> of arguments and 
          returns a 
          <a href="apidocs/org/apache/commons/cli/CommandLine.html">
          <code>CommandLine</code></a>.
        </p>
        <p>
          The result of the parsing stage is a <code>CommandLine</code>
          instance.
        </p>
      </section>
      <section name="Interrogation Stage">
        <p>
          The interrogation stage is where the application querys the
          <code>CommandLine</code> to decide what execution branch to
          take depending on boolean options and to use the option values
          to provide the application data.
        </p>
        <p>
          This stage is implemented in the user code.  The accessor methods 
          on <code>CommandLine</code> provide the interrogation capability
          to the user code.
        </p>
        <p>
          The <a href="usage.html">Simple Option</a> document provides examples
          how to create an <code>Options</code> object.
        </p>
        <p>
          The result of the interrogation stage is that the user code 
          is fully informed of all the text that was supplied on the command
          line and processed according to the parser and <code>Options</code>
          rules.
        </p>
      </section>
    </body>
  </document>
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message