mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-23 13:57:52 +00:00
no show an void item if the item doesn't exist
This commit is contained in:
parent
548a1e8fcc
commit
59cffbf3eb
1 changed files with 8 additions and 4 deletions
12
lib/Cli.rb
12
lib/Cli.rb
|
@ -164,11 +164,15 @@ class Cli
|
||||||
if not force
|
if not force
|
||||||
result = @m.searchById(id)
|
result = @m.searchById(id)
|
||||||
|
|
||||||
displayFormat(result)
|
if result.length > 0
|
||||||
|
displayFormat(result)
|
||||||
|
|
||||||
confirm = ask("Are you sure to remove the item: #{id} ? (y/N) ")
|
confirm = ask("Are you sure 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
|
||||||
|
end
|
||||||
|
else
|
||||||
|
puts "Nothing result!"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue