Class: Michael::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/michael/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

#authObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/michael/cli.rb', line 39

def auth(*)
  if options[:help]
    invoke :help, ['auth']
  else
    require_relative 'commands/auth'
    ttycfg = TTY::Config.new
    ttycfg.append_path(Michael::CONFIG_DIR_ABSOLUTE_PATH)
    ttycfg.filename = Michael::CONFIG_FILENAME

    cfg = Michael::Services::Configuration.new(ttycfg)

    token = Michael::Services::Github::Token.new(cfg)

    Michael::Commands::Auth.new(TTY::Prompt.new, token, options).execute
  end
end

#versionObject



22
23
24
25
# File 'lib/michael/cli.rb', line 22

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