Class: Vcloud::Core::LoginCli
- Inherits:
-
Object
- Object
- Vcloud::Core::LoginCli
- Defined in:
- lib/vcloud/core/login_cli.rb
Instance Method Summary collapse
-
#initialize(argv_array) ⇒ Vcloud::Core::LoginCLI
constructor
Create a new instance of the CLI, parsing the arguments supplied.
-
#run ⇒ void
Login to vCloud and print shell commands suitable for setting the vcloud_token.
Constructor Details
#initialize(argv_array) ⇒ Vcloud::Core::LoginCLI
Create a new instance of the CLI, parsing the arguments supplied
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
#run ⇒ void
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 |