summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd2/parsing.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/parsing.py b/cmd2/parsing.py
index fe08420a..9b86b487 100644
--- a/cmd2/parsing.py
+++ b/cmd2/parsing.py
@@ -315,10 +315,10 @@ class StatementParser:
if not word:
return False, 'cannot be an empty string'
- errmsg = 'cannot start with a shortcut: '
- errmsg += ', '.join(shortcut for (shortcut, expansion) in self.shortcuts)
for (shortcut, expansion) in self.shortcuts:
if word.startswith(shortcut):
+ errmsg = 'cannot start with a shortcut: '
+ errmsg += ', '.join(shortcut for (shortcut, expansion) in self.shortcuts)
return False, errmsg
errmsg = 'cannot contain: whitespace, quotes, '