diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-05-21 17:07:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-21 17:07:36 -0700 |
commit | b513c16d61bbded9cdab06238f8fcb1c03963217 (patch) | |
tree | 0d8e7238843a55d5fc35190d317000fcacef50a2 /cmd2.py | |
parent | 8297145a74ee4d239cfb7d68a47f59342fd831fe (diff) | |
parent | a57c664511a42eeeafa530d185f5ff89c6060496 (diff) | |
download | cmd2-git-b513c16d61bbded9cdab06238f8fcb1c03963217.tar.gz |
Merge pull request #103 from python-cmd2/multiline_abbreviations0.7.1
Multiline abbreviations
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -600,7 +600,7 @@ class Cmd(cmd.Cmd): excludeFromHistory = '''run r list l history hi ed edit li eof'''.split() # make sure your terminators are not in legalChars! legalChars = u'!#$%.:?@_-' + pyparsing.alphanums + pyparsing.alphas8bit - multilineCommands = [] + multilineCommands = [] # NOTE: Multiline commands can never be abbreviated, even if abbrev is True noSpecialParse = 'set ed edit exit'.split() prefixParser = pyparsing.Empty() redirector = '>' # for sending output to file @@ -1089,7 +1089,7 @@ class Cmd(cmd.Cmd): result = target else: if self.abbrev: # accept shortened versions of commands - funcs = [fname for fname in self.keywords if fname.startswith(arg)] + funcs = [func for func in self.keywords if func.startswith(arg) and func not in self.multilineCommands] if len(funcs) == 1: result = 'do_' + funcs[0] return result |