A coding kata to practise the argument parser problem
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README

README

The argument parser
### ######## ######

The specification I wish to implement:

ArgumentParser:
* There are 2 types of options, long options and short options
  * [E.g] Short Option: -b
  * [E.g] Long Option: --bee

* Either option can have no value, an optional value or a mandatory value
  * Short Specs:
    * [E.g] Sepcified as: "b" No value
    * [E.g] Sepcified as: "b:" Mandatory value
    * [E.g] Sepcified as: "b::" Optional value
  * Long Specs:
    * [E.g] Sepcified as: "bee" No value
    * [E.g] Sepcified as: "bee:" Mandatory value
    * [E.g] Sepcified as: "bee::" Optional value
* Many short options can be specified at once
    * [E.g] Sepcified as: "b💿:" No values
* Only one long option can be specified at once
    * [E.g] Sepcified as: "bee:" Mandatory value

* Short Options are parsed as a single occurance of the option indicator
    * [E.g] "-b"
* Short Options with no value are returned as True
* Short Options can be combined
    * [E.g] "-abc"
* Long Options are parsed with a prceeding "--"
    * [E.g] "--bee"
* Values can be separated from their option by :, = or whitespace
* The last combined short option can contain a vlue
    * [E.g] "-abc=d"
* Values can be encompassed in single, double or no quotes
    * [E.g] "--foo='bar'"
    * [E.g] '--foo="bar"'

* All unassigned values will belong to the command
* Incorrect Options can either: Cause an Error or Ommit from results
* Missing Options can either: Cause an Error or Ommit from results
* The short option indicator can be either - or /
* The long option indicator can only be -
* Options can be either case sensitive or case insensitive
* Aliases can be configured between options

* The command can take any number of Arguments
    * Command Arguments not Option Arguments
* Help text can be displayed by:
    * ?
    * -?
    * -h
    * /?
    * /h
    * -help
    * --help
* -- Escapes all remaining output as command values