summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Renamed use_ipython keyword parameter of cmd2.Cmd.__init__() to include_ipy.py_refactorKevin Van Brunt2021-03-2612-22/+17
| | | | | | | | | | Added include_py keyword parameter to cmd2.Cmd.__init__(). If False, then the py command will not be available. Removed ability to run Python commands from the command line with py. Made banners and exit messages of Python and IPython consistent. Changed utils.is_text_file() to raise OSError if file cannot be read.
* Fixed colors example codeKevin Van Brunt2021-03-231-4/+4
|
* No longer using -1 as an exit codeexit_codeKevin Van Brunt2021-03-232-2/+2
|
* Resolves comments from PREric Lin2021-03-189-12/+14
|
* Updated tab completion exampleKevin Van Brunt2021-03-021-3/+4
|
* Fixed black, isort, flake8, and doc8 issuesTodd Leonhardt2021-02-194-46/+61
|
* Merge branch 'master' into blackTodd Leonhardt2021-02-197-188/+187
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # 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-2228-44/+168
| |\
| * \ Merge branch 'master' into 2.0Kevin Van Brunt2020-09-171-0/+80
| |\ \
| * \ \ Merge branch '2.0' into read_inputKevin Van Brunt2020-09-051-0/+1
| |\ \ \
| | * \ \ Merge branch 'master' into 2.0Kevin Van Brunt2020-09-051-0/+1
| | |\ \ \
| * | \ \ \ Merge branch '2.0' into read_inputKevin Van Brunt2020-09-033-6/+6
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge branch 'master' into 2.0Kevin Van Brunt2020-09-033-6/+6
| | |\ \ \ \
| * | | | | | Updated read_input exampleKevin Van Brunt2020-09-011-10/+33
| | | | | | |
| * | | | | | Added read_input() exampleKevin Van Brunt2020-09-011-0/+89
| |/ / / / /
| * | | | | Merge branch 'master' into 2.0Kevin Van Brunt2020-08-281-2/+2
| |\ \ \ \ \
| * \ \ \ \ \ Merge branch 'master' into 2.0Kevin Van Brunt2020-08-272-2/+2
| |\ \ \ \ \ \
| * \ \ \ \ \ \ Merge branch 'master' into 2.0Kevin Van Brunt2020-08-251-1/+1
| |\ \ \ \ \ \ \
| * | | | | | | | Updated async printing example to use thread event instead of a boolean flagKevin Van Brunt2020-08-181-7/+7
| | | | | | | | |
| * | | | | | | | Replaced choices_function / choices_method with choices_provider.Kevin Van Brunt2020-08-135-149/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 in isort changesTodd Leonhardt2021-01-3117-24/+69
| | | | | | | | |
* | | | | | | | | Attempt to fix remaining black failuresTodd Leonhardt2021-01-312-6/+5
| | | | | | | | |
* | | | | | | | | Add black for automatic code formatTodd Leonhardt2021-01-3137-269/+253
| |_|_|_|_|_|_|/ |/| | | | | | |
* | | | | | | | Changed isort to force wrapping of imports to reduce merge conflicts from ↵Eric Lin2021-01-2228-48/+183
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | minor import changes.
* | | | | | | Changes default category to be heritable by default - meaning that ↵Eric Lin2020-09-111-0/+80
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | subclasses will inherit the parent class's default category. Adds optional flag to disable heritability.
* | | | | | Added always_show_hint settingKevin Van Brunt2020-09-051-0/+1
| |_|_|_|/ |/| | | | | | | | | | | | | | Fixed issue where flag names weren't always sorted correctly in argparse tab completion
* | | | | Fixed type hints in example code1.3.9Kevin Van Brunt2020-09-031-1/+1
| | | | |
* | | | | Updated docsKevin Van Brunt2020-09-013-5/+5
| |_|_|/ |/| | |
* | | | 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-262-2/+2
| |/ |/| | | | | | | | | | | 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 RecursionError when printing an argparse.Namespace caused by custom ↵Kevin Van Brunt2020-08-251-1/+1
|/ | | | | | attribute cmd2 was adding Added get_statement() function to argparse.Namespace which returns __statement__ attribute
* Breaking change: Removed cmd2 app as a required second parameter toEric Lin2020-08-126-51/+51
| | | | | | 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
|
* Marked with_arparser_and_unknown_args deprecated and consolidatedEric Lin2020-08-043-3/+3
| | | | implementation as an option to with_argparser instead.
* 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.
* updated importsEric Lin2020-08-045-5/+128
| | | | Added additional documentation
* Updates the example to remove usage of the now remove ability toEric Lin2020-08-044-43/+56
| | | | | | | | | | 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.
* cleanupEric Lin2020-08-041-7/+7
|
* Sort imports using isortTodd Leonhardt2020-08-042-2/+2
|
* Fixes issue with locating help_ annd complete_ functions when autoloading ↵Eric Lin2020-08-041-0/+17
| | | | | | command functions Adds handling of some edge cases. More thorough test coverage.
* Some minor cleanup of how imports work. Fixed issue with help documentation ↵Eric Lin2020-08-042-4/+2
| | | | | | for CommandSet commands. Issue #943
* Initial implementation of modular command loadingEric Lin2020-08-044-0/+265
| | | | | | | | | | Issue #943 New class CommandSet can be used to tag a class as a command class. If the constructor is simple, the object will automatically be instantiated and loaded. New register_command decorator to tag any arbitrary function as a command.
* Updated argparse_completer to use TableCreator for the hint tableKevin Van Brunt2020-05-281-1/+1
|
* Added info on semantic versioning and branching strategy to CONTRIBUTING.mdTodd Leonhardt2020-04-2415-14/+20
| | | | | | | 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
* Updated tab completion documentationKevin Van Brunt2020-04-231-1/+1
|
* Removed tableformatter example since cmd2 now has its own table creator ↵Kevin Van Brunt2020-04-211-204/+0
| | | | library and example program