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 aRuntimeErrorif called from the main thread.
2.4.0 (February 22, 2022)
- Bug Fixes
- Fixed issue in
ansi.async_alert_str()which would raiseIndexErrorif 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
PassThroughExceptionto__init__.pyimports. - 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.fgandcmd2.bgwhich were deprecated in 2.3.0. Usecmd2.Fgandcmd2.Bginstead.
- Deleted
2.3.3 (November 29, 2021)
- Enhancements
- Added clearer exception handling to
BorderedTableandSimpleTable.
- Added clearer exception handling to
2.3.2 (November 22, 2021)
- Bug Fixes
- Fixed issue where a
ns_providercould be passedNoneinstead of its correctcmd2.CmdorCommandSetvalue.
- Fixed issue where a
2.3.1 (November 18, 2021)
- Bug Fixes
- Fixed issue introduced in 2.3.0 with
AlternatingTable,BorderedTable, andSimpleTablethat caused
header alignment settings to be overridden by data alignment settings.
- Fixed issue introduced in 2.3.0 with
- Enhancements
CompletionItemsnow saves the original object from which it creates a string.- Using
CompletionItemsas argparse choices is fully supported.cmd2patchedargparseto compare input to
the original value instead of theCompletionItemsinstance. ArgparseCompleternow does the following if a list ofCompletionItemswas 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
AttributeErrorinrl_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.EightBitFgandcmd2.EightBitBgclasses. - Added support for 24-bit/RGB colors with the
cmd2.RgbFgandcmd2.RgbBgclasses. - Removed dependency on colorama.
- Changed type of
ansi.allow_stylefrom a string to anansi.AllowStyleEnum class.
- Added settings to Column class which prevent a table from overriding existing styles in header
- Deprecations
- Deprecated
cmd2.fg. Usecmd2.Fginstead. - Deprecated
cmd2.bg. Usecmd2.Bginstead.
- Deprecated
- Breaking Changes
- To support the color upgrade, all cmd2 colors now inherit from either
ansi.FgColororansi.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_typekeyword 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 modifyingArgparseCompleterbehavior. - Using
SimpleTablein 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
CompletionItemsnow includes divider row comprised ofCmd.rulercharacter. - Removed
--verboseflag 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.promptnot 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.Actionclassget_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.Actionclass, 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
pluginsandtests_isolateddirectories to tarball published to PyPI forcmd2release
- Restored