Cmd2

Latest version: v2.4.3

Safety actively analyzes 630450 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 15

1.3.2

* Bug Fixes
* Fixed `prog` value of subcommands added with `as_subcommand_to()` decorator.
* Fixed missing settings in subcommand parsers created with `as_subcommand_to()` decorator. These settings
include things like description and epilog text.
* Fixed issue with CommandSet auto-discovery only searching direct sub-classes
* Enhancements
* Added functions to fetch registered CommandSets by type and command name

1.3.1

* Bug Fixes
* Fixed issue determining whether an argparse completer function required a reference to a containing
CommandSet. Also resolves issues determining the correct CommandSet instance when calling the argparse
argument completer function. Manifested as a TypeError when using `cmd2.Cmd.path_complete` as a completer
for an argparse-based command defined in a CommandSet

1.3.0

* Enhancements
* Added CommandSet - Enables defining a separate loadable module of commands to register/unregister
with your cmd2 application.
* Other
* Marked with_argparser_and_unknown_args pending deprecation and consolidated implementation into
with_argparser

1.2.1

* Bug Fixes
* Relax minimum version of `importlib-metadata` to >= 1.6.0 when using Python < 3.8

1.2.0

* Bug Fixes
* Fixed `typing` module compatibility issue with Python 3.5 prior to 3.5.4
* Enhancements
* Switched to getting version using `importlib.metadata` instead of using `pkg_resources`
* Improves `cmd2` application launch time on systems that have a lot of Python packages on `sys.path`
* Added dependency on `importlib_metadata` when running on versions of Python prior to 3.8

1.1.0

* Bug Fixes
* Fixed issue where subcommand usage text could contain a subcommand alias instead of the actual name
* Fixed bug in `ArgparseCompleter` where `fill_width` could become negative if `token_width` was large
relative to the terminal width.
* Enhancements
* Made `ipy` consistent with `py` in the following ways
* `ipy` returns whether any of the commands run in it returned True to stop command loop
* `Cmd.in_pyscript()` returns True while in `ipy`.
* Starting `ipy` when `Cmd.in_pyscript()` is already True is not allowed.
* `with_argument_list`, `with_argparser`, and `with_argparser_and_unknown_args` wrappers now pass
`kwargs` through to their wrapped command function.
* Added `table_creator` module for creating richly formatted tables. This module is in beta and subject
to change.
* See [table_creation](https://cmd2.readthedocs.io/en/latest/features/table_creation.html)
documentation for an overview.
* See [table_creation.py](https://github.com/python-cmd2/cmd2/blob/master/examples/table_creation.py)
for an example.
* Added the following exceptions to the public API
* `SkipPostcommandHooks` - Custom exception class for when a command has a failure bad enough to skip
post command hooks, but not bad enough to print the exception to the user.
* `Cmd2ArgparseError` - A `SkipPostcommandHooks` exception for when a command fails to parse its arguments.
Normally argparse raises a `SystemExit` exception in these cases. To avoid stopping the command
loop, catch the `SystemExit` and raise this instead. If you still need to run post command hooks
after parsing fails, just return instead of raising an exception.
* Added explicit handling of `SystemExit`. If a command raises this exception, the command loop will be
gracefully stopped.

Page 5 of 15

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.