Class: Vcloud::Core::LoginCli

Inherits:
Object
  • Object
show all
Defined in:
lib/vcloud/core/login_cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv_array) ⇒ Vcloud::Core::LoginCLI

Create a new instance of the CLI, parsing the arguments supplied

Parameters:

  • argv_array (Array)

    The Array of ARGV arguments



12
13
14
15
16
# File 'lib/vcloud/core/login_cli.rb', line 12

def initialize(argv_array)
  @usage_text = nil

  parse(argv_array)
end

Instance Method Details

#runvoid

This method returns an undefined value.

Login to vCloud and print shell commands suitable for setting the vcloud_token



21
22
23
24
25
26
27
28
29
# File 'lib/vcloud/core/login_cli.rb', line 21

def run
  begin
    pass = read_pass
    puts Vcloud::Core::Fog::Login.token_export(pass)
  rescue => e
    $stderr.puts(e)
    exit 1
  end
end