Skip to content

Releases: python-cmd2/cmd2

1.3.1 (August 6, 2020)

06 Aug 20:11
Compare
Choose a tag to compare
  • 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 (August 4, 2020)

04 Aug 19:47
Compare
Choose a tag to compare
  • 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 (July 14, 2020)

14 Jul 23:45
Compare
Choose a tag to compare
  • Bug Fixes
    • Relax minimum version of importlib-metadata to >= 1.6.0 when using Python < 3.8

1.2.0 (July 13, 2020)

14 Jul 01:11
104f9af
Compare
Choose a tag to compare
  • 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 (June 6, 2020)

06 Jun 17:46
Compare
Choose a tag to compare
  • 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.
    • 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.

1.0.2 (April 06, 2020)

06 Apr 17:31
Compare
Choose a tag to compare
  • Bug Fixes
    • Ctrl-C now stops a running text script instead of just the current run_script command
  • Enhancements
    • do_shell() now saves the return code of the command it runs in self.last_result for use in pyscripts

1.0.1 (March 13, 2020)

13 Mar 15:55
Compare
Choose a tag to compare
  • Bug Fixes
    • Fixed issue where postcmd hooks were running after an argparse exception in a command.

1.0.0 (March 1, 2020)

01 Mar 23:52
Compare
Choose a tag to compare
  • Enhancements
    • The documentation at cmd2.rftd.io received a major overhaul
  • Other
    • Moved categorize utility function from decorators module to utils module
  • Notes

0.10.1 (February 19, 2020)

19 Feb 16:45
8b6f4b3
Compare
Choose a tag to compare
  • Bug Fixes
    • Corrected issue where the actual new value was not always being printed in do_set. This occurred in cases where the typed value differed from what the setter had converted it to.
    • Fixed bug where ANSI style sequences were not correctly handled in utils.truncate_line().
    • Fixed bug where pyscripts could edit cmd2.Cmd.py_locals dictionary.
    • Fixed bug where cmd2 set sys.path[0] for a pyscript to cmd2's working directory instead of the script file's directory.
    • Fixed bug where sys.path was not being restored after a pyscript ran.
  • Enhancements
    • Renamed set command's -l/--long flag to -v/--verbose for consistency with help and history commands.
    • Setting the following pyscript variables:
      • __name__: main
      • __file__: script path (as typed, ~ will be expanded)
    • Only tab complete after redirection tokens if redirection is allowed
    • Made CompletionError exception available to non-argparse tab completion
    • Added apply_style to CompletionError initializer. It defaults to True, but can be set to False if you don't want the error text to have ansi.style_error() applied to it when printed.
  • Other
    • Removed undocumented py run command since it was replaced by run_pyscript a while ago
    • Renamed AutoCompleter to ArgparseCompleter for clarity
    • Custom EmptyStatement exception is no longer part of the documented public API
  • Notes
    • This is a beta release leading up to the 1.0.0 release
    • We intend no more breaking changes prior to 1.0.0
      • Just bug fixes, documentation updates, and enhancements

0.10.0 (February 7, 2020)

08 Feb 04:46
Compare
Choose a tag to compare
  • Enhancements
    • Changed the default help text to make help -v more discoverable
    • set command now supports tab-completion of values
    • Added add_settable() and remove_settable() convenience methods to update self.settable dictionary
    • Added convenience ansi.fg and ansi.bg enums of foreground and background colors
      • ansi.style() fg argument can now either be of type str or ansi.fg
      • ansi.style() bg argument can now either be of type str or ansi.bg
      • This supports IDE auto-completion of color names
      • The enums also support
        • f-strings and format() calls (e.g. "{}hello{}".format(fg.blue, fg.reset))
        • string concatenation (e.g. fg.blue + "hello" + fg.reset)
  • Breaking changes
    • Renamed locals_in_py attribute of cmd2.Cmd to self_in_py
    • The following public attributes of cmd2.Cmd are no longer settable at runtime by default:
      • continuation_prompt
      • self_in_py
      • prompt
    • self.settable changed to self.settables
      • It is now a Dict[str, Settable] instead of Dict[str, str]
      • setting onchange callbacks have a new method signature and must be added to the
        Settable instance in order to be called
    • Removed cast() utility function
    • Removed ansi.FG_COLORS and ansi.BG_COLORS dictionaries
      • Replaced with ansi.fg and ansi.bg enums providing similar but improved functionality
  • Notes
    • This is an alpha release leading up to the 1.0.0 release
    • We intend no more breaking changes prior to 1.0.0
      • Just bug fixes, documentation updates, and enhancements