Class: HammerCLI::ShellMainCommand::AuthCommand::LogoutCommand

Inherits:
AbstractCommand
  • Object
show all
Defined in:
lib/hammer_cli/shell.rb

Instance Method Summary collapse

Methods inherited from AbstractCommand

#adapter, #exception_handler, inherited_output_definition, #initialize, output, #output, output_definition, #output_definition, #parent_command, #parse, remove_subcommand, #run, subcommand, subcommand!, validate_options, #validate_options

Constructor Details

This class inherits a constructor from HammerCLI::AbstractCommand

Instance Method Details

#executeObject



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/hammer_cli/shell.rb', line 48

def execute
  context[:username] = nil
  context[:password] = nil

  if username(false)
    print_message("Credentials deleted, using defaults now.")
    print_message("You are logged in as [ %s ]." % username(false))
  else
    print_message("Credentials deleted.")
  end
  HammerCLI::EX_OK
end