Class: Vcloud::Launcher::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/vcloud/launcher/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv_array) ⇒ Cli

Returns a new instance of Cli.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/vcloud/launcher/cli.rb', line 7

def initialize(argv_array)
  @config_file = nil
  @usage_text = nil
  @options = {
    "vapp-name"         => false,
    "dont-power-on"     => false,
    "continue-on-error" => false,
    "quiet"             => false,
    "post-launch-cmd"   => false,
    "verbose"           => false,
    "dry-run"           => false,
  }

  parse(argv_array)
end

Instance Method Details

#runObject



23
24
25
26
27
28
29
30
31
# File 'lib/vcloud/launcher/cli.rb', line 23

def run
  begin
    launch = Vcloud::Launcher::Launch.new(@config_file, @options)
    launch.run
  rescue => error_msg
    $stderr.puts(error_msg)
    exit 1
  end
end