Intro the show command for future details (tags for now)

This commit is contained in:
Jeff Blaine 2013-04-25 22:04:57 +00:00
parent bf307f6df8
commit 8494a4b66b
1 changed files with 26 additions and 0 deletions

View File

@ -74,6 +74,32 @@ module Blimpy
fleet.start
end
desc 'show', 'Show blimp details for running blimps'
method_options :tags => :boolean
def show
ensure_blimpfile
blimps = current_blimps
unless blimps
puts 'No currently running VMs'
exit 0
end
tags_option = options[:tags]
blimps.each do |blimp, data|
if tags_option
tags = nil
data[:tags].each do |k,v|
if tags.nil?
tags = "#{k}=#{v}"
elsif
tags = "#{tags},#{k}=#{v}"
end
end
puts "#{data[:name]} #{data[:internal_dns]} #{tags}"
end
end
end
desc 'status', 'Show running blimps'
def status
ensure_blimpfile