Skip to content

Releases: python-cmd2/cmd2

2.5.0 (October 23, 2024)

24 Oct 03:04
Compare
Choose a tag to compare
  • Breaking Change
    • cmd2 2.5 supports Python 3.8+ (removed support for Python 3.6 and 3.7)
  • Bug Fixes
    • Fixed issue where persistent history file was not saved upon SIGHUP and SIGTERM signals.
    • Multiline commands are no longer fragmented in up-arrow history.
    • Fixed bug where async_alert() overwrites readline's incremental and non-incremental search prompts.
      • This fix introduces behavior where an updated prompt won't display after an aborted search
        until a user presses Enter. See async_printing.py
        example for how to handle this case using Cmd.need_prompt_refresh() and Cmd.async_refresh_prompt().
  • Enhancements
    • Removed dependency on attrs and replaced with dataclasses
    • add allow_clipboard initialization parameter and attribute to disable ability to
      add output to the operating system clipboard
    • Updated unit tests to be Python 3.13 compliant.
    • Fall back to bz2 compression of history file when lzma is not installed.
    • Added settable called scripts_add_to_history which determines whether scripts and pyscripts
      add commands to history.
  • Deletions (potentially breaking changes)
    • Removed apply_style from Cmd.pwarning().

2.4.3 (January 27, 2023)

28 Jan 00:51
Compare
Choose a tag to compare
  • Bug Fixes
    • Fixed ValueError caused when passing Cmd.columnize() strings wider than display_width.
  • Enhancements
    • Renamed utils.str_to_bool() -> utils.to_bool().
    • Enhanced utils.to_bool() so that it accepts and converts bool, int, and float in addition to str.

2.4.2 (July 13, 2022)

13 Jul 15:56
Compare
Choose a tag to compare
  • 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)

13 Apr 21:48
Compare
Choose a tag to compare
  • Bug Fixes
    • Fixed value for ansi.Bg.YELLOW.
    • Fixed unit tests for ansi.allow_style.
  • Enhancements
    • async_alert() raises a RuntimeError if called from the main thread.

2.4.0 (February 22, 2022)

23 Feb 01:43
Compare
Choose a tag to compare
  • Bug Fixes
    • Fixed issue in ansi.async_alert_str() which would raise IndexError if prompt was blank.
    • Fixed issue where tab completion was quoting argparse flags in some cases.
  • 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)
  • Deletions (potentially breaking changes)
    • Deleted cmd2.fg and cmd2.bg which were deprecated in 2.3.0. Use cmd2.Fg and cmd2.Bg instead.

2.3.3 (November 29, 2021)

29 Nov 20:30
Compare
Choose a tag to compare
  • Enhancements
    • Added clearer exception handling to BorderedTable and SimpleTable.

2.3.2 (November 22, 2021)

22 Nov 20:47
Compare
Choose a tag to compare
  • Bug Fixes
    • Fixed issue where a ns_provider could be passed None instead of its correct cmd2.Cmd or CommandSet value.

2.3.1 (November 18, 2021)

19 Nov 04:10
Compare
Choose a tag to compare
  • Bug Fixes
    • Fixed issue introduced in 2.3.0 with AlternatingTable, BorderedTable, and SimpleTable that caused
      header alignment settings to be overridden by data alignment settings.
  • Enhancements
    • CompletionItems now saves the original object from which it creates a string.
    • Using CompletionItems as argparse choices is fully supported. cmd2 patched argparse to compare input to
      the original value instead of the CompletionItems instance.
    • ArgparseCompleter now does the following if a list of CompletionItems 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)

11 Nov 21:07
Compare
Choose a tag to compare
  • Bug Fixes
    • Fixed AttributeError in rl_get_prompt() when prompt is None.
    • 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.
  • 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, and SimpleTables.
    • Added support for 8-bit/256-colors with the cmd2.EightBitFg and cmd2.EightBitBg classes.
    • Added support for 24-bit/RGB colors with the cmd2.RgbFg and cmd2.RgbBg classes.
    • Removed dependency on colorama.
    • Changed type of ansi.allow_style from a string to an ansi.AllowStyle Enum class.
  • Deprecations
    • Deprecated cmd2.fg. Use cmd2.Fg instead.
    • Deprecated cmd2.bg. Use cmd2.Bg instead.
  • Breaking Changes
    • To support the color upgrade, all cmd2 colors now inherit from either ansi.FgColor or ansi.BgColor.
      Therefore, ansi.style() no longer accepts colors as strings.

2.2.0 (September 14, 2021)

14 Sep 17:22
Compare
Choose a tag to compare
  • 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 of ArgparseCompleter.
    • Added ArgumentParser.get_ap_completer_type() and ArgumentParser.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 to Cmd2ArgumentParser.__init__() which saves a call
      to set_ap_completer_type(). This keyword will also work with add_parser() when creating subcommands
      if the base command's parser is a Cmd2ArgumentParser.
    • New function register_argparse_argument_parameter() allows developers to specify custom
      parameters to be passed to the argparse parser's add_argument() method. These parameters will
      become accessible in the resulting argparse Action object when modifying ArgparseCompleter 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 of Cmd.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 for self.prompt not matching Readline's current prompt.
  • Deletions (potentially breaking changes)
    • Deleted set_choices_provider() and set_completer() which were deprecated in 2.1.2
  • Breaking Changes
    • Renamed set_default_argument_parser() to set_default_argument_parser_type()