Class: Hammerhead::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/hammerhead/cli.rb

Overview

Handle the application command line parsing and the dispatch to various command objects

Constant Summary collapse

Error =

Error raised by this runner

Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#clientsObject



65
66
67
68
69
70
71
72
# File 'lib/hammerhead/cli.rb', line 65

def clients
  if options[:help]
    invoke :help, ['clients']
  else
    require_relative 'commands/clients'
    Hammerhead::Commands::Clients.new(options).execute
  end
end

#status(client) ⇒ Object



46
47
48
49
50
51
52
53
# File 'lib/hammerhead/cli.rb', line 46

def status client
  if options[:help]
    invoke :help, ['status']
  else
    require_relative 'commands/status'
    Hammerhead::Commands::Status.new(client, options).execute
  end
end

#versionObject



15
16
17
18
# File 'lib/hammerhead/cli.rb', line 15

def version
  require_relative 'version'
  puts "v#{Hammerhead::VERSION} Hammerhead 🦈"
end