ConsoleOptionParser (class)
Class ConsoleOptionParser
Handles parsing the ARGV in the command line and provides support for GetOpt compatible option definition. Provides a builder pattern implementation for creating shell option parsers.
Options
Named arguments come in two forms, long and short. Long arguments are preceded by two - and give a more verbose option name. i.e. --version
. Short arguments are preceded by one - and are only one character long. They usually match with a long option, and provide a more terse alternative.
Using Options
Options can be defined with both long and short forms. By using $parser->addOption()
you can define new options. The name of the option is used as its long form, and you can supply an additional short form, with the short
option. Short options should only be one letter long. Using more than one letter for a short option will raise an exception.
Calling options can be