diff options
Diffstat (limited to 'cmd2/parsing.py')
-rw-r--r-- | cmd2/parsing.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd2/parsing.py b/cmd2/parsing.py index 27d17d21..6c687439 100644 --- a/cmd2/parsing.py +++ b/cmd2/parsing.py @@ -315,10 +315,11 @@ class StatementParser: if not word: return False, 'cannot be an empty string' - for (shortcut, expansion) in self.shortcuts: + for (shortcut, _) in self.shortcuts: if word.startswith(shortcut): + # Build an error string with all shortcuts listed errmsg = 'cannot start with a shortcut: ' - errmsg += ', '.join(shortcut for (shortcut, expansion) in self.shortcuts) + errmsg += ', '.join(shortcut for (shortcut, _) in self.shortcuts) return False, errmsg errmsg = 'cannot contain: whitespace, quotes, ' |