Easy commands now take a target VM name

It is assumed to be the first arg, as long as the first arg doesn't
begin as a flag "-foo"
This commit is contained in:
Mitchell Hashimoto 2012-06-01 15:59:05 +02:00
parent 83917a6bb0
commit fd9ad904fe
1 changed files with 6 additions and 1 deletions

View File

@ -59,9 +59,14 @@ module Vagrant
# halt our own execution here.
return 0 if !argv
# The Multi-VM argument is the first argument as long as the
# first argument is not a flag.
names = nil
names = argv[0] if argv[0] !~ /^-/
# Run the action for each VM.
@logger.info("Running easy command: #{@command}")
with_target_vms do |vm|
with_target_vms(names) do |vm|
@logger.debug("Running easy command for VM: #{vm.name}")
@runner.call(CommandAPI.new(vm, argv))
end