Class: Vcloud::NetLauncher::Cli

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

Instance Method Summary collapse

Constructor Details

#initialize(argv_array) ⇒ void

Initiates parsing of the command-line arguments.

Parameters:

  • argv_array (Array)

    Command-line arguments



11
12
13
14
15
16
# File 'lib/vcloud/net_launcher/cli.rb', line 11

def initialize(argv_array)
  @usage_text = nil
  @config_file = nil

  parse(argv_array)
end

Instance Method Details

#runvoid

This method returns an undefined value.

Runs Vcloud::NetLauncher::NetLaunch#run to create networks defined in @config_file, catching any exceptions to prevent printing a backtrace.



22
23
24
25
26
27
28
29
# File 'lib/vcloud/net_launcher/cli.rb', line 22

def run
  begin
    Vcloud::NetLauncher::NetLaunch.new.run(@config_file)
  rescue => error_msg
    $stderr.puts(error_msg)
    exit 1
  end
end