summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcmd2.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/cmd2.py b/cmd2.py
index ed92a757..a23400d8 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -323,9 +323,8 @@ def tokens_for_completion(line, begidx, endidx, preserve_quotes=False):
while True:
try:
- # This type of parsing works better than shlex.split() which doesn't seem to treat > as an individual token.
# Use non-POSIX parsing to keep the quotes around the tokens.
- tokens = list(shlex.shlex(tmp_line[:tmp_endidx], posix=False))
+ tokens = shlex.split(tmp_line[:tmp_endidx], posix=False)
break
except ValueError:
# ValueError can be caused by missing closing quote