Permalink
Browse files

fixing an issue with updating and deleting

  • Loading branch information...
1 parent 73ce188 commit 890c7ef553a63c4657e7ed272fa37c9f7b99180d @jondruse committed Mar 24, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 bin/pvault
View
@@ -74,6 +74,10 @@ command :main do |c|
when "copy"
if input.size == 2
p = vault.get_password(input.last)
+ if p.nil?
+ puts "couldn't find password with name #{input.last}"
+ redo
+ end
Clipboard.copy(p.password)
puts "password for #{p.name} copied to your clipboard"
else
@@ -90,6 +94,12 @@ command :main do |c|
when "update"
if input.size == 2
p = vault.get_password(input.last)
+
+ if p.nil?
+ puts "couldn't find password with name #{input.last}"
+ redo
+ end
+
p.name = ask("Name: ")
p.password = ask("Password: ") { |q| q.echo = false }
p.username = ask("Username: ")

0 comments on commit 890c7ef

Please sign in to comment.