Use longest machine name to pad in status cmd
This commit is contained in:
parent
16002d03c0
commit
97aed37aea
|
@ -12,11 +12,16 @@ module VagrantPlugins
|
||||||
argv = parse_options(opts)
|
argv = parse_options(opts)
|
||||||
return if !argv
|
return if !argv
|
||||||
|
|
||||||
|
max_name_length = 0
|
||||||
|
with_target_vms(argv) do |machine|
|
||||||
|
max_name_length = machine.name.length if machine.name.length > max_name_length
|
||||||
|
end
|
||||||
|
|
||||||
state = nil
|
state = nil
|
||||||
results = []
|
results = []
|
||||||
with_target_vms(argv) do |machine|
|
with_target_vms(argv) do |machine|
|
||||||
state = machine.state if !state
|
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
|
end
|
||||||
|
|
||||||
message = nil
|
message = nil
|
||||||
|
|
Loading…
Reference in New Issue