diff options
author | Lars Wirzenius <liw@liw.fi> | 2010-12-07 10:36:23 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2010-12-07 10:36:23 +0000 |
commit | ea559066a15c5fc67268db2b117e25e1b066b0c2 (patch) | |
tree | ce29b23fc091dd758222e32770e89777720a70bf | |
parent | e682409d2443a8651673ed560fee81e9874f70de (diff) | |
download | liw-automation-ea559066a15c5fc67268db2b117e25e1b066b0c2.tar.gz |
Add remove commmand.
-rwxr-xr-x | scripts/journal-note | 7 |
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') |