Skip to content
This repository has been archived by the owner on Mar 30, 2020. It is now read-only.

Commit

Permalink
Added action output
Browse files Browse the repository at this point in the history
  • Loading branch information
bjeanes committed Aug 20, 2008
1 parent f0f67c3 commit ebd1957
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bin/ghost
Expand Up @@ -27,14 +27,16 @@ 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
end
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
Expand All @@ -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]}"
Expand Down

0 comments on commit ebd1957

Please sign in to comment.