API
- class commanger.commanger(globe='commanger.tools')
- Automethod:
commanger.commanger.command :decorator:
- Automethod:
commanger.commanger.commandU :decorator:
- exception ArgumentError
- exception ArgumentTypeError
- basicCfig(l: list, bl=True)
Form a basic config and set commanger.cfig to the output unless bl = False.
Returns: config dict
Example: cmd.basicCfig([1, 2, ‘3’, ‘four’]) Goes to:
`python {1: {'type': 'pos', 'in': [None], 'pos': 1, 'base': None}, 2: {'type': 'pos', 'in': [None], 'pos': 2, 'base': None}, '3': {'type': 'tg', 'base': False}, 'four': {'type': 'ltg', 'base': False}} `
- command(funct)
Funct that runs on command. Key function. It is recommended to have only one of commanger.command and commanger.commandU
Returns: None
Expect: A dict as the single argument
Example: ```python @commanger.command def main(args):
#do stuff
- commandU(funct)
Funct that runs on command. Key function. It is recommended to have only one of commanger.command and commanger.commandU
Returns: None
Expect: **kwargs as arguments.
Examples: ```python @commanger.commandU def main(**kwargs): #get as dict
#do stuff
``` ```python @commanger.commandU def main(*, hi, bye, hello): #get as individual args
#do stuff
- evalArgs(args)
Dev funct evalArgs: Evaluates args.
- ppconfig(config=None)
Get a pretty version of commanger.cfig or supplied config
Returns: string