From ebd1957d70c6a9e5f08e4d67dbcc00bc865348e2 Mon Sep 17 00:00:00 2001 From: Bodaniel Jeanes Date: Wed, 20 Aug 2008 12:15:19 +1000 Subject: [PATCH] Added action output --- bin/ghost | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/ghost b/bin/ghost index 862d607..3f93974 100755 --- a/bin/ghost +++ b/bin/ghost @@ -27,7 +27,8 @@ else when 'add': if [2,3].include?(ARGV.size) ARGV.shift - Host.add(*ARGV) + host = Host.add(*ARGV) + puts " [Adding] #{host.name} -> #{host.ip}" else $stderr.puts "The add subcommand requires at least a hostname.\n\n" help_text 2 @@ -35,6 +36,7 @@ else when 'delete': if ARGV.size == 2 Host.delete(ARGV[1]) + puts " [Deleting] #{ARGV[1]}" else $stderr.puts "The delete subcommand requires a hostname.\n\n" help_text 2 @@ -49,9 +51,10 @@ else puts "#{host.name.rjust(pad+2)} -> #{host.ip}" end exit 0 - when 'empty': + when 'empty': + print " [Emptying] " Host.empty! - puts "Emptied host list." + puts "Done." exit 0 else $stderr.puts "Invalid option: #{ARGV[0]}"