Commit 691074ad authored by Bram Schoenmakers's avatar Bram Schoenmakers

Split a command's arguments with shlex.

This fixes the issue that `ls -F "%p %s"` doesn't work, because the
double quotes weren't interpreted properly.

Reported by @mruwek.
parent 12ef56d7
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
""" Entry file for the topydo Prompt interface (CLI). """ """ Entry file for the topydo Prompt interface (CLI). """
import os.path import os.path
import shlex
import sys import sys
from topydo.cli.CLIApplicationBase import CLIApplicationBase, error, usage from topydo.cli.CLIApplicationBase import CLIApplicationBase, error, usage
...@@ -94,7 +95,8 @@ class PromptApplication(CLIApplicationBase): ...@@ -94,7 +95,8 @@ class PromptApplication(CLIApplicationBase):
try: try:
user_input = prompt(u'topydo> ', history=history, user_input = prompt(u'topydo> ', history=history,
completer=self.completer, completer=self.completer,
complete_while_typing=False).split() complete_while_typing=False)
user_input = shlex.split(user_input)
except (EOFError, KeyboardInterrupt): except (EOFError, KeyboardInterrupt):
sys.exit(0) sys.exit(0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment