Merge pull request #2016 from mcourtois/fix/master/status_cosmetic

commands/status: Cosmetic fix to align machine name and states in the status command
This commit is contained in:
Mitchell Hashimoto 2013-08-09 11:14:15 -07:00
commit 0dfeec4fae
1 changed files with 6 additions and 1 deletions

View File

@ -12,11 +12,16 @@ module VagrantPlugins
argv = parse_options(opts)
return if !argv
max_name_length = 25
with_target_vms(argv) do |machine|
max_name_length = machine.name.length if machine.name.length > max_name_length
end
state = nil
results = []
with_target_vms(argv) do |machine|
state = machine.state if !state
results << "#{machine.name.to_s.ljust(25)} #{machine.state.short_description} (#{machine.provider_name})"
results << "#{machine.name.to_s.ljust(max_name_length)} #{machine.state.short_description} (#{machine.provider_name})"
end
message = nil