1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-10-27 02:33:19 +00:00

show item before remove

This commit is contained in:
nishiki 2013-08-26 21:23:35 +02:00
parent 029f2c2064
commit a37139e4a9

12
Cli.rb
View file

@ -139,6 +139,18 @@ class Cli
# force -> no resquest a validation # force -> no resquest a validation
def remove(id, force=false) def remove(id, force=false)
if not force if not force
result = @m.searchById(id)
puts "# --------------------"
puts "# Id: #{id}"
puts "# Name: #{result[MPW::NAME]}"
puts "# Group: #{result[MPW::GROUP]}"
puts "# Server: #{result[MPW::SERVER]}"
puts "# Type: #{result[MPW::PROTOCOL]}"
puts "# Login: #{result[MPW::LOGIN]}"
puts "# Port: #{result[MPW::PORT]}"
puts "# Comment: #{result[MPW::COMMENT]}"
confirm = ask("Are you sur to remove the item: #{id} ? (y/N) ") confirm = ask("Are you sur to remove the item: #{id} ? (y/N) ")
if confirm =~ /^(y|yes|YES|Yes|Y)$/ if confirm =~ /^(y|yes|YES|Yes|Y)$/
force = true force = true