summaryrefslogtreecommitdiff
path: root/cmd2
Commit message (Collapse)AuthorAgeFilesLines
* Added more command validation. Moved some common behavior into private ↵Eric Lin2020-08-042-27/+50
| | | | functions.
* Fixes to sphinx generationEric Lin2020-08-042-2/+2
|
* Fixes issue with locating help_ annd complete_ functions when autoloading ↵Eric Lin2020-08-042-26/+35
| | | | | | command functions Adds handling of some edge cases. More thorough test coverage.
* add ability to remove commands and commandsetsEric Lin2020-08-042-5/+54
| | | | Issue #943
* Added new constructor parameter to flag whether commands should autoload. ↵Eric Lin2020-08-041-31/+83
| | | | | | Added unit tests. Moved installing commands into separate functions that can be called Issue #943
* Some minor cleanup of how imports work. Fixed issue with help documentation ↵Eric Lin2020-08-043-7/+23
| | | | | | for CommandSet commands. Issue #943
* Initial implementation of modular command loadingEric Lin2020-08-042-2/+186
| | | | | | | | | | 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.
* Added 'no cover' for code block which cannot be tested in our unit testsKevin Van Brunt2020-08-031-1/+1
|
* Added type annotations for fields in cmd2.Cmd.Eric Lin2020-07-212-27/+29
| | | | | | | Cleaned up docstring in external test plugin Updated some initialization to match new approach for version info discovery. Tagged some IDE-only lines as no-cover Adds plugin coverage reporting.
* Fixed hook documentationKevin Van Brunt2020-07-171-4/+4
|
* Added PyCharm warning suppressionsTodd Leonhardt2020-07-131-0/+2
|
* small simplificationTodd Leonhardt2020-07-131-2/+1
|
* slight cleanupTodd Leonhardt2020-07-131-2/+2
|
* Address fact that typing.Deque wasn't defined prior to 3.5.4Todd Leonhardt2020-07-131-1/+9
|
* replace pkg_resources with importlib.metadataDoug Hellmann2020-07-121-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Importing pkg_resources has a side-effect of scanning every installed distribution on sys.path to load the metadata, especially the entry points defined in the packages. This can have a significant launch-time cost for command line applications when there are a lot of distributions to scan. Since cmd2 is only using pkg_resources to find the version of the installed package, pkg_resources can be replaced with importlib.metadata. The implementation in the new library is significantly faster because it goes immediately to the metadata file for the requested distribution, instead of scanning all of them. There are also no import-time side-effects. importlib.metadata is a new standard library module starting with python 3.8. For earlier versions, a compatible library has been released to PyPI as 'importlib_metadata'. This change adds the new dependency with a qualifier so that it is only applied to older versions of python, and then updates the places that were importing pkg_resources to look for the different versions of the new library instead. The documentation configuration is changed to import cmd2 itself to get its version, since the package has to be installed for the metadata to be available anyway. Signed-off-by: Doug Hellmann <doug@doughellmann.com>
* Removed divider row from tab completion hint tableKevin Van Brunt2020-06-011-1/+1
|
* Optimized importsKevin Van Brunt2020-06-011-2/+1
|
* Merge branch 'master' into hint_bugKevin Van Brunt2020-06-013-29/+53
|\
| * Removed pwarning() calls when command raises SystemExitKevin Van Brunt2020-05-281-2/+0
| | | | | | | | Added unit tests
| * Made following changes to onecmd_plus_hooks()Kevin Van Brunt2020-05-072-21/+29
| | | | | | | | | | 1. Added SystemExit handling by warning the user it's occured and setting stop to True 2. KeyboardInterrupts won't be raised if stop is already set to True.
| * Added SkipPostcommandHooks exception and made Cmd2ArgparseError inherit from it.Kevin Van Brunt2020-05-073-12/+30
| | | | | | | | Both exception classes have been added to the public API.
* | Simplied table divider code for ease of readingKevin Van Brunt2020-06-011-3/+5
| |
* | Changed how SimpleTable creates divider when divider_char is wide. It no ↵Kevin Van Brunt2020-06-012-32/+45
| | | | | | | | longer stretches the width of the table.
* | Changed SimpleTable.base_width() to a class method and added equivalent ↵Kevin Van Brunt2020-05-281-10/+30
| | | | | | | | method to BorderedTable.
* | Updated argparse_completer to use TableCreator for the hint tableKevin Van Brunt2020-05-283-31/+80
|/
* Added info on semantic versioning and branching strategy to CONTRIBUTING.mdTodd Leonhardt2020-04-248-20/+21
| | | | | | | 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
|
* Documented CompletionError classKevin Van Brunt2020-04-231-4/+4
|
* Updated _set_parser_prog() so future calls to add_parser() will set the ↵Kevin Van Brunt2020-04-231-1/+5
| | | | | | correct prog value This makes dynamically adding subcommands after the CLI starts easier.
* Fixed issue where subcommand usage text could contain a subcommand alias ↵Kevin Van Brunt2020-04-231-5/+20
| | | | instead of the actual name
* Merge branch 'master' into table_creatorKevin Van Brunt2020-04-222-16/+43
|\
| * run_pyscript now passes a keyword arg to do_py instead of using a hidden ↵Kevin Van Brunt2020-04-211-9/+8
| | | | | | | | argparse flag
| * argument_list and argparse wrappers now pass kwargs through to the wrapped ↵Kevin Van Brunt2020-04-201-7/+35
| | | | | | | | command function
* | Merge branch 'master' into table_creatorKevin Van Brunt2020-04-223-23/+49
|\ \ | |/
| * Updated error textKevin Van Brunt2020-04-201-4/+2
| |
| * cmd2 now considers ipy a pyscript environmentKevin Van Brunt2020-04-201-8/+17
| |
| * Consistently use :raises: instead of :raises (make sure there is a trailing ↵Todd Leonhardt2020-04-203-6/+6
| | | | | | | | colon)
| * Fix doc buildTodd Leonhardt2020-04-201-1/+1
| |
| * ipy now returns its PyBridge's stop value so the main loop can know to stop. ↵Kevin Van Brunt2020-04-201-10/+29
| | | | | | | | This is consistent with the py command.
* | Updating documentation for table creationKevin Van Brunt2020-04-221-3/+5
| |
* | Updated docsKevin Van Brunt2020-04-223-14/+17
| |
* | Updated docstrings to work with sphinxKevin Van Brunt2020-04-201-10/+12
| |
* | Added configurable padding to BorderedTable/AlternatingTableKevin Van Brunt2020-04-191-53/+104
| | | | | | | | Updated comments
* | Merge branch 'master' into table_creatorTodd Leonhardt2020-04-153-87/+89
|\ \ | |/
| * Removed exception handling around tempfile.TemporaryFile()Kevin Van Brunt2020-04-131-5/+1
| |
| * onecmd_plus_hooks() no longer handles updating any state data related to ↵Kevin Van Brunt2020-04-122-51/+56
| | | | | | | | | | | | redirection. For simplicity, it's all done in _redirect_output() and _restore_output().
| * Simplfied _redirect_output() by raising exception instead of returning boolKevin Van Brunt2020-04-113-39/+40
| |
| * Simplified onecmd_plus_hooks by reducing number of calls to ↵Kevin Van Brunt2020-04-111-6/+6
| | | | | | | | _run_cmdfinalization_hooks()
* | Merge branch 'master' into table_creatorKevin Van Brunt2020-04-113-9/+10
|\ \ | |/
| * Made some optional arguments with defaults keyword-only.Kevin Van Brunt2020-04-113-9/+10
| | | | | | | | | | Added unit test for echo argument to pyscript app() command. Removed _relative_load from hidden commands since that command was renamed.