Class: Central::Cli::WhoamiCommand
- Inherits:
-
Clamp::Command
- Object
- Clamp::Command
- Central::Cli::WhoamiCommand
- Includes:
- Common
- Defined in:
- lib/central/cli/whoami_command.rb
Instance Method Summary collapse
Methods included from Common
#access_token=, #add_master, #api_url, #api_url=, #clear_current_stack, #client, #current_master, #current_master=, #current_master_index, #current_stack, #current_stack=, #ensure_custom_ssl_ca, #require_api_url, #require_current_stack, #require_token, #reset_client, #save_settings, #settings, #settings_filename
Instance Method Details
#execute ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/central/cli/whoami_command.rb', line 6 def execute if bash_completion_path? puts File.realpath(File.join(__dir__, '../scripts/init')) exit 0 end require_api_url puts "Master: #{current_master['name']}" puts "URL: #{api_url}" puts "Stack: #{current_stack}" token = require_token user = client(token).get('user') puts "User: #{user['email']}" end |