summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-12-07 10:36:23 +0000
committerLars Wirzenius <liw@liw.fi>2010-12-07 10:36:23 +0000
commitea559066a15c5fc67268db2b117e25e1b066b0c2 (patch)
treece29b23fc091dd758222e32770e89777720a70bf
parente682409d2443a8651673ed560fee81e9874f70de (diff)
downloadliw-automation-ea559066a15c5fc67268db2b117e25e1b066b0c2.tar.gz
Add remove commmand.
-rwxr-xr-xscripts/journal-note7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/journal-note b/scripts/journal-note
index 5a41e70..3cd7b78 100755
--- a/scripts/journal-note
+++ b/scripts/journal-note
@@ -55,6 +55,7 @@ class App(object):
'new': self.new_entry,
'list': self.list_entries,
'edit': self.edit_entry,
+ 'remove': self.remove_entry,
'finish': self.finish_entry,
}
@@ -114,6 +115,12 @@ class App(object):
raise AppException('draft %s does not exist' % args[0])
self.gedit_file(pathname)
+ def remove_entry(self, args, opts):
+ if not args:
+ raise AppException('Usage: journal-note remove ID')
+ pathname = os.path.join(self.drafts(opts), args[0] + '.mdwn')
+ os.remove(pathname)
+
def finish_entry(self, args, opts):
if not args:
raise AppException('Usage: journal-note finish ID')