summaryrefslogtreecommitdiff
path: root/cmd2/argparse_custom.py
Commit message (Collapse)AuthorAgeFilesLines
* Updated main code to use f-stringsKevin Van Brunt2021-04-131-12/+10
|
* And that's the last of it. Passes mypy.Eric Lin2021-04-061-3/+31
|
* More mypy fixesEric Lin2021-04-061-10/+21
|
* More mypy validation changes. cmd2.py is nearly fully mypy compliant now.Eric Lin2021-04-021-4/+3
|
* More things to make mypy happy.Eric Lin2021-04-021-2/+2
|
* Resolves comments from PREric Lin2021-03-181-31/+110
|
* Some mypy validation fixesEric Lin2021-03-181-27/+43
|
* Start making small changes to fix mypy warningsTodd Leonhardt2021-02-211-4/+5
|
* Fixed black, isort, flake8, and doc8 issuesTodd Leonhardt2021-02-191-13/+17
|
* Merge branch 'master' into blackTodd Leonhardt2021-02-191-119/+62
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # cmd2/__init__.py # cmd2/argparse_completer.py # cmd2/argparse_custom.py # cmd2/cmd2.py # cmd2/decorators.py # cmd2/exceptions.py # cmd2/utils.py # examples/arg_decorators.py # examples/argparse_completion.py # examples/modular_commands_main.py # tests/test_argparse_completer.py # tests/test_argparse_custom.py # tests/test_cmd2.py # tests/test_completion.py # tests/test_history.py
| * Merge branch 'master' into 2.0Kevin Van Brunt2021-01-221-4/+19
| |\
| * \ Merge branch 'master' into 2.0Todd Leonhardt2020-11-111-11/+13
| |\ \ | | | | | | | | | | | | | | | | # Conflicts: # CHANGELOG.md
| * \ \ Merge branch 'master' into 2.0Kevin Van Brunt2020-08-271-1/+19
| |\ \ \
| * | | | Documented support for standalone functions being used as completers and ↵Kevin Van Brunt2020-08-181-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | choices_providers. Added unit tests for this case.
| * | | | Replaced choices_function / choices_method with choices_provider.Kevin Van Brunt2020-08-131-100/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced completer_function / completer_method with completer. ArgparseCompleter now always passes cmd2.Cmd or CommandSet instance as the self argument to choices_provider and completer functions. Moved basic_complete from utils into cmd2.Cmd class. Moved CompletionError to exceptions.py
* | | | | Add black for automatic code formatTodd Leonhardt2021-01-311-36/+55
| |_|_|/ |/| | |
* | | | Changed isort to force wrapping of imports to reduce merge conflicts from ↵Eric Lin2021-01-221-4/+19
| |_|/ |/| | | | | | | | minor import changes.
* | | Fixed issue where instantiating more than one cmd2-based class which uses ↵duplicate_subcommandKevin Van Brunt2020-09-301-11/+13
| |/ |/| | | | | | | | | the @as_subcommand_to decorator resulted in duplicated help text in the base command the subcommands belong to.
* | The functions cmd2 adds to Namespaces (get_statement() and get_handler()) ↵Kevin Van Brunt2020-08-261-1/+19
|/ | | | | | | 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.
* Fixed bug when trying to format help text of argument which used a tuple as ↵Kevin Van Brunt2020-08-121-18/+27
| | | | its metavar
* Breaking change: Removed cmd2 app as a required second parameter toEric Lin2020-08-121-9/+2
| | | | | | CommandSet command functions (do_, complete_, help_). Renamed install_command_set and uninstall_command_set to register_command_set and unregister_command_set.
* Minor formatting fixes. Injecting a function into namespace objects before ↵Eric Lin2020-08-041-1/+0
| | | | passing to command handlers to access sub-command handlers
* Now maintains a command->CommandSet mapping and passes the CommandSetanselor2020-08-041-11/+35
| | | | | | | | | | | | | | | through to the ArgparseCompleter if one is registered. For subcommands, the registered argparse instance for the subcommand is now tagged with the CommandSet from which it originated. If a CommandSet is detected, it's now passed in as 'self' for the completion functions. Fixes some issue found with removing a subcommand. Adds additional tests. Added a check to prevent removal of a CommandSet if it has commands with sub-commands from another CommandSet bound to it. Documentation improvements. Standardized around using CommandSetRegistrationException during commandset install/uninstall related errors. Added support for nested sub-command injection.
* Updated documentationKevin Van Brunt2020-08-041-2/+10
|
* Updated documentationKevin Van Brunt2020-08-041-1/+5
|
* Fixed typo in documentationKevin Van Brunt2020-08-041-3/+3
|
* Removed sub-class and instead patch argparse._SubParsersActionEric Lin2020-08-041-24/+26
|
* Suggested PR Fixes.Eric Lin2020-08-041-1/+1
| | | | | sub-commande => subcommand Added help/aliases to `as_subcommand_to` decorator.
* Adds support for injectable subcommands as part of CommandSetEric Lin2020-08-041-2/+30
| | | | | | load/unload. Updated examples and documentation to include discussion of injectable sub-commands.
* Updates the example to remove usage of the now remove ability toEric Lin2020-08-041-5/+26
| | | | | | | | | | register arbitrary functions as commands. Added example that demonstrates use of each of the command decorators with CommandSets. Adds unit test that verifies that CommandSets containing decorators load and process commands correctly. Updated the constructor declaration for Cmd2ArgumentParser to explicitly re-declare argparse constructor parameters.
* Added info on semantic versioning and branching strategy to CONTRIBUTING.mdTodd Leonhardt2020-04-241-1/+1
| | | | | | | Also: - Added isort to Pipenv dev - Added setup.cfg to make it easy to run flake8, doc8, and isort directly from the command line without using invoke - Ran isort to sort includes
* Completion doc updatesKevin Van Brunt2020-04-231-12/+9
|
* Merge branch 'master' into table_creatorKevin Van Brunt2020-04-221-1/+1
|\
| * Consistently use :raises: instead of :raises (make sure there is a trailing ↵Todd Leonhardt2020-04-201-1/+1
| | | | | | | | colon)
* | Initial commit of table creation APIKevin Van Brunt2020-04-091-11/+8
|/
* Removed duplicate word and capitalized two comment sentencesKevin Van Brunt2020-02-251-2/+2
|
* Add argparse stuff to apikotfu2020-02-221-142/+173
|
* Made CompletionError exception available to non-argparse tab completionKevin Van Brunt2020-02-171-18/+0
|
* Renamed AutoCompleter to ArgparseCompleter for clarityKevin Van Brunt2020-02-171-12/+12
|
* Removed dash from 'tab complete' stringKevin Van Brunt2020-02-131-7/+7
|
* Removed repeated Pycharm warning suppressionKevin Van Brunt2020-02-071-1/+1
|
* Renamed ansi_safe_wcswidth() to style_aware_wcswidth()Kevin Van Brunt2019-12-191-2/+2
| | | | Renamed ansi_aware_write() to style_aware_write()
* Fixed typo in documentationKevin Van Brunt2019-12-041-1/+1
|
* Fixed bug where a redefined ansi.style_error was not being used in all cmd2 ↵Kevin Van Brunt2019-11-271-3/+3
| | | | files
* Added documentationKevin Van Brunt2019-11-241-1/+2
|
* Added capability to override the argument parser class used by cmd2 built-in ↵Kevin Van Brunt2019-11-191-1/+11
| | | | commands
* Added unit tests for CompletionErrorKevin Van Brunt2019-09-231-3/+10
|
* Added CompletionError exception classKevin Van Brunt2019-09-201-0/+11
|
* Changed arg_tokens to a dictionaryKevin Van Brunt2019-09-161-4/+4
| | | | Including tokens from parent parsers in arg_tokens when subcommands are used
* Updated documentationKevin Van Brunt2019-09-131-0/+14
|