Permalink
Browse files

Added delete task

  • Loading branch information...
quirkey committed Oct 28, 2008
1 parent 1ab44dc commit 04432e884ede89d58de7e7698dece253bb24f481
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/purse/cli.rb
View
@@ -29,7 +29,9 @@ def run(args)
else
find(pocket_name, note_name)
end
- end
+ end
+ rescue MissingFile
+ say("could not find note: #{pocket_name}/#{note_name}")
end
protected
@@ -104,6 +106,12 @@ def edit(pocket_name, note_name)
end
end
+ def delete(pocket_name, note_name)
+ pocket = init(pocket_name)
+ note = pocket.find(note_name)
+ note.delete if cli.agree("are you sure you want to delete #{pocket_name}/#{note_name}? (y/n)")
+ end
+
def push(pocket_name)
pocket = init(pocket_name)
say("Committing local changes for #{pocket_name}")

0 comments on commit 04432e8

Please sign in to comment.