Class: VagrantPlugins::ShellCommander::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-shell-commander/command.rb

Overview

Main plugin command

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#envObject

Returns the value of attribute env.



5
6
7
# File 'lib/vagrant-shell-commander/command.rb', line 5

def env
  @env
end

Instance Method Details

#executeObject

Main entry point of this command



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/vagrant-shell-commander/command.rb', line 9

def execute
  cli_options = OptionManager.new.execute
  argv = parse_options(cli_options[:parser])
  
  return unless argv
  
  if [nil, ''].include? cli_options[:values][:cmd]
  env.ui.info cli_options[:parser]
  else
    with_target_vms(argv) do |machine|
      manage_machine(machine, cli_options) 
    end
  end
  0
end