Class: Phase::CLI::Keys

Inherits:
Command show all
Defined in:
lib/phase/cli/keys.rb

Defined Under Namespace

Classes: AuthorizedKeys

Constant Summary collapse

LOCKFILE_NAME =
"phase.keys.lock"

Instance Attribute Summary

Attributes inherited from Command

#args, #options

Instance Method Summary collapse

Methods inherited from Command

#initialize

Methods included from Util::Console

#ask, #fail, #log

Constructor Details

This class inherits a constructor from Phase::CLI::Command

Instance Method Details

#runObject



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/phase/cli/keys.rb', line 25

def run
  log "backing up existing keys..."
  authorized_keys.backup!

  if email = options.grant
    add_key(email)
  elsif email = options.revoke
    remove_key(email, options.delete)
  else
    print_keys_list
  end
end