Commit 16f397f1 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Fix -E flag

parent ebb3b4c2
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
import os import os
import codecs import codecs
import tempfile import tempfile
import shlex
from subprocess import CalledProcessError, check_call from subprocess import CalledProcessError, check_call
from topydo.lib.Config import config from topydo.lib.Config import config
...@@ -48,7 +49,7 @@ class EditCommand(MultiCommand): ...@@ -48,7 +49,7 @@ class EditCommand(MultiCommand):
self.edit_archive = True self.edit_archive = True
self.multi_mode = False self.multi_mode = False
elif p_opt == '-E': elif p_opt == '-E':
self.editor = p_value self.editor = shlex.split(p_value)
def _process_flags(self): def _process_flags(self):
""" """
...@@ -82,7 +83,7 @@ class EditCommand(MultiCommand): ...@@ -82,7 +83,7 @@ class EditCommand(MultiCommand):
def _open_in_editor(self, p_file): def _open_in_editor(self, p_file):
try: try:
return check_call(config().editor() + [p_file]) return check_call(self.editor + [p_file])
except CalledProcessError: except CalledProcessError:
self.error('Something went wrong in the editor...') self.error('Something went wrong in the editor...')
return 1 return 1
......
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