summaryrefslogtreecommitdiff
path: root/examples/modular_subcommands.py
Commit message (Collapse)AuthorAgeFilesLines
* Adds pre-commit config to run various lintersci_improvementsxNinjaKittyx2020-12-151-0/+1
| | | | | | | This ads black, isort, pyupgrade, and flake8 to pre-commit-config.yaml There are also some small changes to travis.yml and tasks.py to reduce some repeated configurations that should be consolidated into setup.cfg. Most other changes are automated by the linter scripts.
* Fixed type hints in example code1.3.9Kevin Van Brunt2020-09-031-1/+1
|
* Updated docsKevin Van Brunt2020-09-011-2/+2
|
* Fixed issue where subcommand added with @as_subcommand_to decorator did not ↵Kevin Van Brunt2020-08-271-2/+2
| | | | | | display help when called with -h/--help. 'add_help=False' no longer has to be passed to parsers used in @as_subcommand_to decorator.
* The functions cmd2 adds to Namespaces (get_statement() and get_handler()) ↵Kevin Van Brunt2020-08-261-1/+1
| | | | | | | are now Cmd2AttributeWrapper objects named cmd2_statement and cmd2_handler. This makes it easy to filter out which attributes in an argparse.Namespace were added by cmd2.
* Breaking change: Removed cmd2 app as a required second parameter toEric Lin2020-08-121-12/+12
| | | | | | CommandSet command functions (do_, complete_, help_). Renamed install_command_set and uninstall_command_set to register_command_set and unregister_command_set.
* Minor housekeeping. Updated CODEOWNERS with recent additionsEric Lin2020-08-071-1/+1
|
* Moved code which copies subparser's settings to _register_subcommands().Kevin Van Brunt2020-08-071-5/+7
| | | | | Changed alias and macro commands to use as_subcommand_to() decorator. Updated CommandSet subcommand example to use help and description text.
* Removed obsolete argument1.3.0Kevin Van Brunt2020-08-041-1/+1
|
* Minor formatting fixes. Injecting a function into namespace objects before ↵Eric Lin2020-08-041-3/+3
| | | | passing to command handlers to access sub-command handlers
* Suggested PR Fixes.Eric Lin2020-08-041-3/+3
| | | | | sub-commande => subcommand Added help/aliases to `as_subcommand_to` decorator.
* Adds support for injectable subcommands as part of CommandSetEric Lin2020-08-041-0/+110
load/unload. Updated examples and documentation to include discussion of injectable sub-commands.