summaryrefslogtreecommitdiff
path: root/cmd2/parsing.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-09-28 10:21:01 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-09-28 10:21:01 -0400
commite9e25188079f3006d79f4e5d30b6e297ffab0ea5 (patch)
treebc6794b18baba7a4ff4839ab75598ae6d7e54a28 /cmd2/parsing.py
parentf150a322c743f5be87a3ebc9c10b1ebe1e9bb67f (diff)
downloadcmd2-git-e9e25188079f3006d79f4e5d30b6e297ffab0ea5.tar.gz
Addressing code review comments
Diffstat (limited to 'cmd2/parsing.py')
-rw-r--r--cmd2/parsing.py5
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, '