Releases: python-cmd2/cmd2
Releases · python-cmd2/cmd2
0.10.1 (February 19, 2020)
- 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
toCompletionError
initializer. It defaults to True, but can be set to False if you don't want the error text to haveansi.style_error()
applied to it when printed.
- Renamed set command's
- Other
- Removed undocumented
py run
command since it was replaced byrun_pyscript
a while ago - Renamed
AutoCompleter
toArgparseCompleter
for clarity - Custom
EmptyStatement
exception is no longer part of the documented public API
- Removed undocumented
- 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)
- Enhancements
- Changed the default help text to make
help -v
more discoverable - set command now supports tab-completion of values
- Added
add_settable()
andremove_settable()
convenience methods to updateself.settable
dictionary - Added convenience
ansi.fg
andansi.bg
enums of foreground and background colorsansi.style()
fg
argument can now either be of typestr
oransi.fg
ansi.style()
bg
argument can now either be of typestr
oransi.bg
- This supports IDE auto-completion of color names
- The enums also support
f-strings
andformat()
calls (e.g."{}hello{}".format(fg.blue, fg.reset)
)- string concatenation (e.g.
fg.blue + "hello" + fg.reset
)
- Changed the default help text to make
- Breaking changes
- Renamed
locals_in_py
attribute ofcmd2.Cmd
toself_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 toself.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
andansi.BG_COLORS
dictionaries- Replaced with
ansi.fg
andansi.bg
enums providing similar but improved functionality
- Replaced with
- Renamed
- 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
0.9.25 (January 26, 2020)
- Enhancements
- Reduced what gets put in package downloadable from PyPI (removed irrelevant CI config files and such)
0.9.24 (January 23, 2020)
- Enhancements
- Flushing stderr when setting the window title and printing alerts for better responsiveness in cases where stderr is not unbuffered.
- Added function to truncate a single line to fit within a given display width.
cmd2.utils.truncate_line
supports characters with display widths greater than 1 and ANSI style sequences. - Added line truncation support to
cmd2.utils
text alignment functions. - Added support for Python 3.9 alpha
0.9.23 (January 9, 2020)
- Bug Fixes
- Fixed bug where startup script containing a single quote in its file name was incorrectly quoted
- Added missing implicit dependency on
setuptools
due to build withsetuptools_scm
- Enhancements
- Added dim text style support via
style()
function andansi.INTENSITY_DIM
setting.
- Added dim text style support via
- Breaking changes
- Renamed the following
ansi
members for accuracy in what types of ANSI escape sequences are handledansi.allow_ansi
->ansi.allow_style
ansi.ansi_safe_wcswidth()
->ansi.style_aware_wcswidth()
ansi.ansi_aware_write()
->ansi.style_aware_write()
- Renamed the following
ansi
members for clarificationansi.BRIGHT
->ansi.INTENSITY_BRIGHT
ansi.NORMAL
->ansi.INTENSITY_NORMAL
- Renamed the following
0.9.22 (December 9, 2019)
- Bug Fixes
- Fixed bug where a redefined
ansi.style_error
was not being used in allcmd2
files
- Fixed bug where a redefined
- Enhancements
- Enabled line buffering when redirecting output to a file
- Added
align_left()
,align_center()
, andalign_right()
to utils.py. All 3 of these functions support ANSI escape sequences and characters with display widths greater than 1. They wrapalign_text()
which is also in utils.py.
0.9.21 (November 26, 2019)
- Bug Fixes
- Fixed bug where pipe processes were not being stopped by Ctrl-C
- Added exception handling to account for non-standard Python environments in which readline is not loaded dynamically from a shared library file
- Enhancements
- Added
read_input()
function that is used to read from stdin. Unlike the Python built-ininput()
, it also has an argument to disable tab completion while input is being entered. - Added capability to override the argument parser class used by cmd2 built-in commands. See override_parser.py example for more details.
- Added
end
argument topfeedback()
to be consistent with the other print functions likepoutput()
. - Added
apply_style
topwarning()
.
- Added
- Breaking changes
- For consistency between all the print functions:
- Made
end
andchop
keyword-only arguments ofppaged()
end
is always added to message inppaged()
- Made
- For consistency between all the print functions:
0.9.20 (November 12, 2019)
- Bug Fixes
- Fixed bug where setting
use_ipython
to False removed ipy command from the entirecmd2.Cmd
class instead of just the instance being created - Fix bug where cmd2 ran 'stty sane' command when stdin was not a terminal
- Fixed bug where setting
- Enhancements
- Send all startup script paths to run_script. Previously we didn't do this if the file was empty, but that showed no record of the run_script command in history.
- Made it easier for developers to override
edit
command by havingdo_history
no longer calldo_edit
. This also removes the need to excludeedit
command from history list. - It is no longer necessary to set the
prog
attribute of an argparser with subcommands. cmd2 now automatically sets the prog value of it and all its subparsers so that all usage statements contain the top level command name and not sys.argv[0].
- Breaking changes
- Some constants were moved from cmd2.py to constants.py
- cmd2 command decorators were moved to decorators.py. If you were importing them via cmd2's __init__.py, then there will be no issues.
0.9.19 (October 14, 2019)
- Bug Fixes
- Fixed
ValueError
exception which could occur when an old format persistent history file is loaded with newcmd2
- Fixed
- Enhancements
- Improved displaying multiline CompletionErrors by indenting all lines
0.9.18 (October 1, 2019)
- Bug Fixes
- Fixed bug introduced in 0.9.17 where help functions for hidden and disabled commands were not being filtered out as help topics
- Enhancements
AutoCompleter
now handles argparse's mutually exclusive groups. It will not tab complete flag names or positionals for already completed groups. It also will print an error if you try tab completing a flag's value if the flag belongs to a completed group.AutoCompleter
now uses the passed-in parser's help formatter to generate hint text. This gives help and hint text for an argument consistent formatting.