Class: Bcli::CLI

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

#loginObject



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

def (*)
  if options[:help]
    invoke :help, ["login"]
  else
    require_relative "commands/login"
    Bcli::Commands::Login.new.execute
  end
end

#newsObject



33
34
35
36
37
38
39
40
# File 'lib/bcli/cli.rb', line 33

def news(*)
  if options[:help]
    invoke :help, ["news"]
  else
    require_relative "commands/news"
    Bcli::Commands::News.new(options).execute
  end
end

#versionObject



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

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