Class: DuniterRbCli::CLI

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

#versionObject



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

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

#wot_countObject



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

def wot_count(*)
  if options[:help]
    invoke :help, ['wot_count']
  else
    require_relative 'commands/wot_count'
    DuniterRbCli::Commands::WotCount.new(options).execute
  end
end

#wot_listObject



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

def wot_list(*)
  if options[:help]
    invoke :help, ['wot_list']
  else
    require_relative 'commands/wot_list'
    DuniterRbCli::Commands::WotList.new(options).execute
  end
end