This module contains functionality for handling the parsed command line arguments.
ProgramArgs instance is created and returned by parse function. It contains values of flags,
options and arguments, which can be read with .flag, .option and .arg functions respectively.
Those functions work on _unique names_, not on option full/short names such as -l or --help.
For repeating options and arguments, plural form functions can be used: .options, .args,
which return all values rather than last one.
When a command or program has sub-commands returned ProgramArgs object forms a hierarchy,
where every subcommand is another instance of ProgramArgs, starting from root which is program args, going down
to selected sub-command.
To simplify working with subcommands, you can use on command that allows to register command handlers
with a simple interface. E.g. consider git-like tool:
Parsed arguments module.
This module contains functionality for handling the parsed command line arguments.
ProgramArgs instance is created and returned by parse function. It contains values of flags, options and arguments, which can be read with .flag, .option and .arg functions respectively. Those functions work on _unique names_, not on option full/short names such as -l or --help.
For repeating options and arguments, plural form functions can be used: .options, .args, which return all values rather than last one.
When a command or program has sub-commands returned ProgramArgs object forms a hierarchy, where every subcommand is another instance of ProgramArgs, starting from root which is program args, going down to selected sub-command.
To simplify working with subcommands, you can use on command that allows to register command handlers with a simple interface. E.g. consider git-like tool: