diff options
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | cmd2/cmd2.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index dca2d32d..cb81ab17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ * `__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 diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 67304636..caeb4ab0 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -1417,8 +1417,8 @@ class Cmd(cmd.Cmd): return None except CompletionError as ex: - err_str = str(ex) # Don't print error and redraw the prompt unless the error has length + err_str = str(ex) if err_str: if ex.apply_style: err_str = ansi.style_error(err_str) |