- Bug Fixes
- Fixed exception caused by tab completing after an invalid subcommand was entered
- Fixed bug where `history -v` was sometimes showing raw and expanded commands when they weren't different
- Fixed bug where multiline commands were having leading and ending spaces stripped. This would mess up quoted
strings that crossed multiple lines.
- Fixed a bug when appending to the clipboard where contents were in reverse order
- Fixed issue where run_pyscript failed if the script's filename had 2 or more consecutive spaces
- Fixed issue where completer function of disabled command would still run
- Enhancements
- Greatly simplified using argparse-based tab completion. The new interface is a complete overhaul that breaks
the previous way of specifying completion and choices functions. See header of [argparse_custom.py](https://github.com/python-cmd2/cmd2/blob/master/cmd2/argparse_custom.py)
for more information.
- Enabled tab completion on multiline commands
- **Renamed Commands Notice**
- The following commands were renamed in the last release and have been removed in this release
- `load` - replaced by `run_script`
- `_relative_load` - replaced by `_relative_run_script`
- `pyscript` - replaced by `run_pyscript`
- We apologize for any inconvenience, but the new names are more self-descriptive
- Lots of end users were confused particularly about what exactly `load` should be loading
- Breaking Changes
- Restored `cmd2.Cmd.statement_parser` to be a public attribute (no underscore)
- Since it can be useful for creating [post-parsing hooks](https://cmd2.readthedocs.io/en/latest/features/hooks.html#postparsing-hooks)
- Completely overhauled the interface for adding tab completion to argparse arguments. See enhancements for more details.
- `ACArgumentParser` is now called `Cmd2ArgumentParser`
- Moved `basic_complete` to utils.py
- Made optional arguments on the following completer methods keyword-only:
`delimiter_complete`, `flag_based_complete`, `index_based_complete`, `path_complete`, `shell_cmd_complete`
- Renamed history option from `--output-file` to `--output_file`
- Renamed `matches_sort_key` to `default_sort_key`. This value determines the default sort ordering of string
results like alias, command, category, macro, settable, and shortcut names. Unsorted tab completion results
also are sorted with this key. Its default value (ALPHABETICAL_SORT_KEY) performs a case-insensitive alphabetical
sort, but it can be changed to a natural sort by setting the value to NATURAL_SORT_KEY.
- `StatementParser` now expects shortcuts to be passed in as dictionary. This eliminates the step of converting the
shortcuts dictionary into a tuple before creating `StatementParser`.
- Renamed `Cmd.pyscript_name` to `Cmd.py_bridge_name`
- Renamed `Cmd.pystate` to `Cmd.py_locals`
- Renamed `PyscriptBridge` to `PyBridge`