diff options
-rwxr-xr-x | jt | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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: |