diff --git a/lib/Cli.rb b/lib/Cli.rb index ee3721f..1f49887 100644 --- a/lib/Cli.rb +++ b/lib/Cli.rb @@ -164,11 +164,15 @@ class Cli if not force result = @m.searchById(id) - displayFormat(result) + if result.length > 0 + displayFormat(result) - confirm = ask("Are you sure to remove the item: #{id} ? (y/N) ") - if confirm =~ /^(y|yes|YES|Yes|Y)$/ - force = true + confirm = ask("Are you sure to remove the item: #{id} ? (y/N) ") + if confirm =~ /^(y|yes|YES|Yes|Y)$/ + force = true + end + else + puts "Nothing result!" end end