summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-02-18 13:15:59 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-02-18 13:15:59 -0500
commitfb118b9fad6a5916c3264568873a77bb03cb4229 (patch)
tree7d6c90c08c1d226704385f0cde0a95f7cdfa4652
parentcaa7865cf16b4ed96b9307b7f943358534ec4a0a (diff)
downloadcmd2-git-fb118b9fad6a5916c3264568873a77bb03cb4229.tar.gz
Updated change log and comment
-rw-r--r--CHANGELOG.md2
-rw-r--r--cmd2/cmd2.py2
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)