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
|
# File 'lib/vagrant-keymanager/command.rb', line 6
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = 'Usage: vagrant keymanager [vm-name]'
o.separator ''
o.version = VagrantPlugins::KeyManager::VERSION
o.program_name = 'vagrant keymanager'
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.get_guest_keys, {
:machine => machine,
:provider => options[:provider]
})
end
end
|