Releases: python-cmd2/cmd2
Releases · python-cmd2/cmd2
2.4.2 (July 13, 2022)
- Enhancements
- Updated argparse decorator to remove annotations when the docstring is used for a command's help text.
- Updated unit test to be Python 3.11 compliant.
2.4.1 (April 13, 2022)
- Bug Fixes
- Fixed value for
ansi.Bg.YELLOW
. - Fixed unit tests for
ansi.allow_style
.
- Fixed value for
- Enhancements
async_alert()
raises aRuntimeError
if called from the main thread.
2.4.0 (February 22, 2022)
- Bug Fixes
- Fixed issue in
ansi.async_alert_str()
which would raiseIndexError
if prompt was blank. - Fixed issue where tab completion was quoting argparse flags in some cases.
- Fixed issue in
- Enhancements
- Added broader exception handling when enabling clipboard functionality via
pyperclip
. - Added
PassThroughException
to__init__.py
imports. - cmd2 now uses pyreadline3 when running any version of Python on Windows
- Improved memory usage in certain use cases of tables (e.g. nested colored tables)
- Added broader exception handling when enabling clipboard functionality via
- Deletions (potentially breaking changes)
- Deleted
cmd2.fg
andcmd2.bg
which were deprecated in 2.3.0. Usecmd2.Fg
andcmd2.Bg
instead.
- Deleted
2.3.3 (November 29, 2021)
- Enhancements
- Added clearer exception handling to
BorderedTable
andSimpleTable
.
- Added clearer exception handling to
2.3.2 (November 22, 2021)
- Bug Fixes
- Fixed issue where a
ns_provider
could be passedNone
instead of its correctcmd2.Cmd
orCommandSet
value.
- Fixed issue where a
2.3.1 (November 18, 2021)
- Bug Fixes
- Fixed issue introduced in 2.3.0 with
AlternatingTable
,BorderedTable
, andSimpleTable
that caused
header alignment settings to be overridden by data alignment settings.
- Fixed issue introduced in 2.3.0 with
- Enhancements
CompletionItems
now saves the original object from which it creates a string.- Using
CompletionItems
as argparse choices is fully supported.cmd2
patchedargparse
to compare input to
the original value instead of theCompletionItems
instance. ArgparseCompleter
now does the following if a list ofCompletionItems
was created with numerical types:- Sorts completion hints numerically
- Right-aligns the left-most column in completion hint table
2.3.0 (November 11, 2021)
- Bug Fixes
- Fixed
AttributeError
inrl_get_prompt()
when prompt isNone
. - Fixed bug where using choices on a Settable didn't verify that a valid choice had been entered.
- Fixed bug introduced in cmd2 2.0.0 in which
select()
converts return values to strings. It should never
have converted return values.
- Fixed
- Enhancements
- Added settings to Column class which prevent a table from overriding existing styles in header
and/or data text. This allows for things like nesting an AlternatingTable in another AlternatingTable. - AlternatingTable no longer automatically applies background color to borders. This was done to improve
appearance since the background color extended beyond the borders of the table. - Added ability to colorize all aspects of
AlternatingTables
,BorderedTables
, andSimpleTables
. - Added support for 8-bit/256-colors with the
cmd2.EightBitFg
andcmd2.EightBitBg
classes. - Added support for 24-bit/RGB colors with the
cmd2.RgbFg
andcmd2.RgbBg
classes. - Removed dependency on colorama.
- Changed type of
ansi.allow_style
from a string to anansi.AllowStyle
Enum class.
- Added settings to Column class which prevent a table from overriding existing styles in header
- Deprecations
- Deprecated
cmd2.fg
. Usecmd2.Fg
instead. - Deprecated
cmd2.bg
. Usecmd2.Bg
instead.
- Deprecated
- Breaking Changes
- To support the color upgrade, all cmd2 colors now inherit from either
ansi.FgColor
oransi.BgColor
.
Therefore,ansi.style()
no longer accepts colors as strings.
- To support the color upgrade, all cmd2 colors now inherit from either
2.2.0 (September 14, 2021)
- Bug Fixes
- Fixed extra space appended to each alias by "alias list" command
- Enhancements
- New function
set_default_ap_completer_type()
allows developer to extend and modify the
behavior ofArgparseCompleter
. - Added
ArgumentParser.get_ap_completer_type()
andArgumentParser.set_ap_completer_type()
. These
methods allow developers to enable custom tab completion behavior for a given parser by using a custom
ArgparseCompleter
-based class. - Added
ap_completer_type
keyword arg toCmd2ArgumentParser.__init__()
which saves a call
toset_ap_completer_type()
. This keyword will also work withadd_parser()
when creating subcommands
if the base command's parser is aCmd2ArgumentParser
. - New function
register_argparse_argument_parameter()
allows developers to specify custom
parameters to be passed to the argparse parser'sadd_argument()
method. These parameters will
become accessible in the resulting argparse Action object when modifyingArgparseCompleter
behavior. - Using
SimpleTable
in the output for the following commands to improve appearance.- help
- set (command and tab completion of Settables)
- alias tab completion
- macro tab completion
- Tab completion of
CompletionItems
now includes divider row comprised ofCmd.ruler
character. - Removed
--verbose
flag from set command since descriptions always show now. - All cmd2 built-in commands now populate
self.last_result
. - Argparse tab completer will complete remaining flag names if there are no more positionals to complete.
- Updated
async_alert()
to account forself.prompt
not matching Readline's current prompt.
- New function
- Deletions (potentially breaking changes)
- Deleted
set_choices_provider()
andset_completer()
which were deprecated in 2.1.2
- Deleted
- Breaking Changes
- Renamed
set_default_argument_parser()
toset_default_argument_parser_type()
- Renamed
2.1.2 (July 5, 2021)
- Enhancements
- Added the following accessor methods for cmd2-specific attributes to the
argparse.Action
classget_choices_callable()
set_choices_provider()
set_completer()
get_descriptive_header()
set_descriptive_header()
get_nargs_range()
set_nargs_range()
get_suppress_tab_hint()
set_suppress_tab_hint()
- Added the following accessor methods for cmd2-specific attributes to the
- Deprecations
- Now that
set_choices_provider()
andset_completer()
have been added as methods to the
argparse.Action
class, the standalone functions of the same name will be removed in version
2.2.0. To update to the new convention, do the following:- Change
set_choices_provider(action, provider)
toaction.set_choices_provider(provider)
- Change
set_completer(action, completer)
toaction.set_completer(completer)
- Change
- Now that
2.1.1 (June 17, 2021)
- Bug Fixes
- Fixed handling of argparse's default options group name which was changed in Python 3.10
- Enhancements
- Restored
plugins
andtests_isolated
directories to tarball published to PyPI forcmd2
release
- Restored