Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 22843 invoked from network); 24 Jun 2002 20:38:40 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 24 Jun 2002 20:38:40 -0000 Received: (qmail 21717 invoked by uid 97); 24 Jun 2002 20:38:50 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 21700 invoked by uid 97); 24 Jun 2002 20:38:49 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 21688 invoked by uid 97); 24 Jun 2002 20:38:48 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 24 Jun 2002 20:38:27 -0000 Message-ID: <20020624203827.99235.qmail@icarus.apache.org> From: jkeyes@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/cli/xdocs introduction.xml navigation.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 @@ CLI - - + + + 1.1 jakarta-commons/cli/xdocs/introduction.xml Index: introduction.xml =================================================================== John Keyes Introduction

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.

Each command line must define the set of options that will be used to define the interface to the application.

CLI uses the Options class, as a container for Option instances. There are two ways to create Options in CLI. One of them is via the constuctors, the other way is via the factory methods defined in Options.

The Simple Option document provides examples how to create an Options object.

The result of the definition stage is an Options instance.

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.

The parse method defined on CommandLineParser takes an Options instance and a java.util.List of arguments and returns a CommandLine.

The result of the parsing stage is a CommandLine instance.

The interrogation stage is where the application querys the CommandLine to decide what execution branch to take depending on boolean options and to use the option values to provide the application data.

This stage is implemented in the user code. The accessor methods on CommandLine provide the interrogation capability to the user code.

The Simple Option document provides examples how to create an Options object.

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 Options rules.

-- To unsubscribe, e-mail: For additional commands, e-mail: