diff options
| author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-03-23 01:17:07 -0400 |
|---|---|---|
| committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-03-23 01:17:07 -0400 |
| commit | 51da5c87757e0e4b4685f0c8b839da7c66b0eaa2 (patch) | |
| tree | 1ce0575ecf9020e1f413574572ac6eae19add2b3 /cmd2.py | |
| parent | 4f21fe86085040407cc4410e3425dcd40f7a6e4a (diff) | |
| download | cmd2-git-51da5c87757e0e4b4685f0c8b839da7c66b0eaa2.tar.gz | |
Added an extra parsing check
Diffstat (limited to 'cmd2.py')
| -rwxr-xr-x | cmd2.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1887,6 +1887,13 @@ class Cmd(cmd.Cmd): # Get all tokens through the one being completed tokens = tokens_for_completion(line, begidx, endidx, preserve_quotes=True) + # Either had a parsing error or are trying to complete the command token + # The latter can happen if default_to_shell is True and parseline() allowed + # assumed something like " or ' was a command. + if tokens is None or len(tokens) == 1: + self.completion_matches = [] + return None + # Get the status of quotes in the token being completed completion_token = tokens[-1] |
