Skip to content

Commit fb118b9

Browse files
committed
Updated change log and comment
1 parent caa7865 commit fb118b9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* `__file__`: script path (as typed, ~ will be expanded)
1515
* Only tab complete after redirection tokens if redirection is allowed
1616
* Made `CompletionError` exception available to non-argparse tab completion
17+
* Added `apply_style` to `CompletionError` initializer. It defaults to True, but can be set to False if
18+
you don't want the error text to have `ansi.style_error()` applied to it when printed.
1719
* Other
1820
* Removed undocumented `py run` command since it was replaced by `run_pyscript` a while ago
1921
* Renamed `AutoCompleter` to `ArgparseCompleter` for clarity

cmd2/cmd2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,8 +1417,8 @@ def complete(self, text: str, state: int) -> Optional[str]:
14171417
return None
14181418

14191419
except CompletionError as ex:
1420-
err_str = str(ex)
14211420
# Don't print error and redraw the prompt unless the error has length
1421+
err_str = str(ex)
14221422
if err_str:
14231423
if ex.apply_style:
14241424
err_str = ansi.style_error(err_str)

0 commit comments

Comments
 (0)