Class: Bartab::CLI

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

#installObject



24
25
26
27
28
29
30
31
# File 'lib/bartab/cli.rb', line 24

def install(*)
  if options[:help]
    invoke :help, ['install']
  else
    require_relative 'commands/install'
    Bartab::Commands::Install.new(options).execute
  end
end

#setupObject



36
37
38
39
40
41
42
43
# File 'lib/bartab/cli.rb', line 36

def setup(*)
  if options[:help]
    invoke :help, ['setup']
  else
    require_relative 'commands/setup'
    Bartab::Commands::Setup.new(options).execute
  end
end

#versionObject



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

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