summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjt11
1 files changed, 8 insertions, 3 deletions
diff --git a/jt b/jt
index b2c9a25..59e4c46 100755
--- a/jt
+++ b/jt
@@ -84,6 +84,13 @@ class ListCommand(Command):
print draft_id, self._app.get_draft_title(filename) or ""
+class EditCommand(Command):
+
+ def run(self, args):
+ filename = self._app.choose_draft(args)
+ self._app.edit_file(filename)
+
+
class JournalTool(cliapp.Application):
cmd_synopsis = {
@@ -168,9 +175,7 @@ class JournalTool(cliapp.Application):
def cmd_edit(self, args):
'''Edit a draft journal entry.'''
-
- filename = self.choose_draft(args)
- self.edit_file(filename)
+ EditCommand(self).run(args)
def choose_draft(self, args):
if len(args) == 0: