mirror of
https://github.com/nishiki/manage-password.git
synced 2025-03-20 05:14:36 +00:00
show item before remove
This commit is contained in:
parent
029f2c2064
commit
a37139e4a9
1 changed files with 12 additions and 0 deletions
12
Cli.rb
12
Cli.rb
|
@ -139,6 +139,18 @@ class Cli
|
|||
# force -> no resquest a validation
|
||||
def remove(id, force=false)
|
||||
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) ")
|
||||
if confirm =~ /^(y|yes|YES|Yes|Y)$/
|
||||
force = true
|
||||
|
|
Loading…
Add table
Reference in a new issue