Class: VagrantPlugins::MultiHostManager::Command
- Inherits:
-
Object
- Object
- VagrantPlugins::MultiHostManager::Command
show all
- Includes:
- HostsFile
- Defined in:
- lib/vagrant-multihostmanager/command.rb
Instance Method Summary
collapse
Methods included from HostsFile
#update_guest, #update_host
Instance Method Details
#execute ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/vagrant-multihostmanager/command.rb', line 6
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = 'Usage: vagrant multihostmanager [vm-name]'
o.separator ''
o.version = VagrantPlugins::MultiHostManager::VERSION
o.program_name = 'vagrant multihostmanager'
o.on('--provider provider', String,
'Update machines with the specific provider.') do |provider|
options[:provider] = provider.to_sym
end
end
argv = parse_options(opts)
options[:provider] ||= @env.default_provider
with_target_vms(argv, options) do |machine|
@env.action_runner.run(Action.update_guest, {
:machine => machine,
:provider => options[:provider]
})
end
@env.action_runner.run(Action.update_host, {
:global_env => @env,
:provider => options[:provider]
})
end
|