summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | | | Fixed flake8 errorKevin Van Brunt2020-09-011-1/+4
| | | | | | | | | | | |
| * | | | | | | | | | | Removed enum.auto() for Python 3.5 compatibilityKevin Van Brunt2020-09-011-3/+3
| | | | | | | | | | | |
| * | | | | | | | | | | Fixed docs errorKevin Van Brunt2020-09-011-1/+2
| | | | | | | | | | | |
| * | | | | | | | | | | Updated commentsKevin Van Brunt2020-09-011-1/+5
| | | | | | | | | | | |
| * | | | | | | | | | | Refactored ArgparseCompleter to support custom completionKevin Van Brunt2020-09-011-43/+29
| | | | | | | | | | | |
| * | | | | | | | | | | Refactored read_input to support custom completionKevin Van Brunt2020-08-311-59/+138
| | | | | | | | | | | |
| * | | | | | | | | | | Refactored complete() to handle custom behavior from read_input()Kevin Van Brunt2020-08-311-74/+101
| |/ / / / / / / / / /
| * | | | | | | | | | Merge branch 'master' into 2.0Kevin Van Brunt2020-08-281-9/+9
| |\ \ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into 2.0Kevin Van Brunt2020-08-271-2/+2
| |\ \ \ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into 2.0Kevin Van Brunt2020-08-251-2/+4
| |\ \ \ \ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into 2.0Kevin Van Brunt2020-08-201-17/+27
| |\ \ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | | | Replaced choices_function / choices_method with choices_provider.Kevin Van Brunt2020-08-131-31/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-311-14/+46
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Attempt to fix remaining black failuresTodd Leonhardt2021-01-311-13/+34
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Add black for automatic code formatTodd Leonhardt2021-01-311-401/+561
| |_|_|_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | |
* | | | | | | | | | | | | | Fixed syntax error in `pip install` command for GitHub ActionsTodd Leonhardt2021-01-301-28/+29
| |_|_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also: - Refactored do_history command to extract a helper method to fix a flake8 warning about high complexity
* | | | | | | | | | | | | Printing error when OSError other than FileNotFoundError occurs when ↵Kevin Van Brunt2021-01-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | deleting persistent history file with history --clear command.
* | | | | | | | | | | | | Fixed FileNotFoundError which occurred when running 'history --clear' and no ↵header_tabsKevin Van Brunt2021-01-281-1/+4
| |_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | history file existed.
* | | | | | | | | | | | Fix flake8 error and make type hinting consistentTodd Leonhardt2021-01-241-1/+1
| | | | | | | | | | | |
* | | | | | | | | | | | Added option to run startup scripts silentlyKevin Van Brunt2021-01-221-2/+7
| |_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | |
* | | | | | | | | | | Changed isort to force wrapping of imports to reduce merge conflicts from ↵Eric Lin2021-01-221-17/+77
| |_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | minor import changes.
* | | | | | | | | | Merge branch 'master' into docstr_fmtTodd Leonhardt2020-11-111-1/+1
|\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | Fixed tab completion crash on Windowswin_tab_crashKevin Van Brunt2020-11-111-1/+1
| | | | | | | | | | |
* | | | | | | | | | | specifying is not none on coditionsBambu2020-11-111-2/+2
| | | | | | | | | | |
* | | | | | | | | | | fix flake8 errorBambu2020-10-191-1/+0
| | | | | | | | | | |
* | | | | | | | | | | Format multiline docstrings to match other help messagesBambu2020-10-091-4/+10
|/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed cmd2 do_cmd to dedent docstrings using `pydoc.getdoc`. This patch provides output for docstrings that look like using argparse or a single line docstring
* | | | | | | | | | Fixed issue where instantiating more than one cmd2-based class which uses ↵duplicate_subcommandKevin Van Brunt2020-09-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the @as_subcommand_to decorator resulted in duplicated help text in the base command the subcommands belong to.
* | | | | | | | | | Fixed issue where quoted redirectors and terminators in aliases and macros ↵Kevin Van Brunt2020-09-301-16/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | were not being restored when read from a startup script.
* | | | | | | | | | Only setting subcommand handler on attached_parser and not its parent parserKevin Van Brunt2020-09-281-4/+6
| |_|_|_|_|_|_|_|/ |/| | | | | | | |
* | | | | | | | | Small refactorsilenceKevin Van Brunt2020-09-171-6/+6
| | | | | | | | |
* | | | | | | | | Merge branch 'master' into silenceKevin Van Brunt2020-09-171-1/+6
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | Changes default category to be heritable by default - meaning that ↵Eric Lin2020-09-111-1/+6
| | |_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subclasses will inherit the parent class's default category. Adds optional flag to disable heritability.
* | | | | | | | | Added --silent flag to alias/macro create.Kevin Van Brunt2020-09-101-12/+36
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | Added --with_silent flag to alias/macro list.
* | | | | | | | Added type hintKevin Van Brunt2020-09-051-2/+1
| |_|_|_|_|_|/ |/| | | | | |
* | | | | | | Added always_show_hint settingKevin Van Brunt2020-09-051-14/+35
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | Fixed issue where flag names weren't always sorted correctly in argparse tab completion
* | | | | | Added CommandSet.on_unregistered()Kevin Van Brunt2020-09-031-2/+4
| | | | | |
* | | | | | Added on_registered() callback to CommandSetKevin Van Brunt2020-09-011-0/+1
| |_|_|_|/ |/| | | |
* | | | | Fixed issue where subcommand added with @as_subcommand_to decorator did not ↵Kevin Van Brunt2020-08-271-9/+9
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | 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-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/+3
| | | | | | | | | | | | | | | | | | attribute cmd2 was adding Added get_statement() function to argparse.Namespace which returns __statement__ attribute
* | | Fixed typoKevin Van Brunt2020-08-211-1/+1
| |/ |/|
* | Added validation of subcommand handler attributesEric Lin2020-08-201-1/+5
| |
* | Fixed AttributeError when CommandSet that uses as_subcommand_to decorator is ↵Kevin Van Brunt2020-08-191-16/+22
|/ | | | loaded during cmd2.Cmd.__init__().
* When passing a ns_provider to an argparse command, will now attempt to ↵Eric Lin2020-08-121-1/+49
| | | | resolve the correct CommandSet instance for self. If not, it'll fall back and pass in the cmd2 app
* Breaking change: Removed cmd2 app as a required second parameter toEric Lin2020-08-121-19/+12
| | | | | | CommandSet command functions (do_, complete_, help_). Renamed install_command_set and uninstall_command_set to register_command_set and unregister_command_set.
* Updated with missing doc-string for new CommandSet parameters for cmd2.Cmd's ↵Eric Lin2020-08-101-0/+8
| | | | constructor
* Will now traverse down CommandSet inheritance tree to find all leaf descendants.1.3.2Eric Lin2020-08-101-8/+38
| | | | | | CommandSet now has a check to ensure it is only registered with one cmd2.Cmd instance at a time. Adds function to find command set by type and by command name
* Moved a comment to better section off codeKevin Van Brunt2020-08-071-8/+8
|
* Removed unnecessary prog value from subcommand parsersKevin Van Brunt2020-08-071-6/+6
|
* Moved code which copies subparser's settings to _register_subcommands().Kevin Van Brunt2020-08-071-155/+175
| | | | | Changed alias and macro commands to use as_subcommand_to() decorator. Updated CommandSet subcommand example to use help and description text.