Class: Tumugi::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.common_optionsObject



9
10
11
12
13
14
15
# File 'lib/tumugi/cli.rb', line 9

def common_options
  option :file, aliases: '-f', desc: 'Workflow file name', required: true
  option :config, aliases: '-c', desc: 'Configuration file name', default: 'tumugi_config.rb'
  option :params, aliases: '-p', type: :hash, desc: 'Task parameters'
  option :quiet, type: :boolean, desc: 'Suppress log', default: false
  option :verbose, type: :boolean, desc: 'Show verbose log', default: false
end

.exit_on_failure?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/tumugi/cli.rb', line 17

def exit_on_failure?
  true
end

Instance Method Details

#run_(task) ⇒ Object



31
32
33
# File 'lib/tumugi/cli.rb', line 31

def run_(task)
  execute(:run, task, options)
end

#show(task) ⇒ Object



39
40
41
# File 'lib/tumugi/cli.rb', line 39

def show(task)
  execute(:show, task, options)
end

#versionObject



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

def version
  puts "tumugi v#{Tumugi::VERSION}"
end