| » Metadata |
» Status |
|
|
|
| » Description |
Command-line arguments parsing class.
This implementation was freely adapted from a Python module called getargs by Vinod Vijayarajan and a Perl CPAN module called Getopt::Simple by Ron Savage.
This class implements a Command Line Parser that applications can use to parse command line arguments in $_SERVER['argv'].
It provides more features than Console_Getopt. It also performs some arguments validation and is capable to return an help text based on the configuration it is given.
The class provides the following capabilities:
- Each command line option can take an arbitrary number of arguments.
- Makes the distinction between switches (options without arguments) and options with arguments.
- Recognizes 'single-argument-options' and 'default-if-set' options.
- Switches and options with arguments can be interleaved in the command line.
- You can specify the maximum and minimum number of arguments an option can take. Use -1 if you don't want to specify an upper bound.
- Specify default arguments to an option
- Short options can be more than one letter in length.
- A given option may be invoked by multiple names.
- Recognizes by default the --help, -h options
- Can return a formatted help text
- Arguments may be specified using the '=' syntax also.
|
| » Dependencies |
» Links |
|
|
|
| » Timeline |
» Changelog |
-
First Draft: 2004-04-21
- Proposal: 2004-04-21
- Call for Votes: 2004-05-07
|
|