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



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

def common_options
  option :file, aliases: '-f', desc: 'Workflow file name', required: true
  option :config, aliases: '-c', desc: 'Configuration file name'
  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
  option :log_format, type: :string, desc: 'Log format', enum: ['text', 'json'], default: 'text'
end

.exit_on_failure?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/tumugi/cli.rb', line 19

def exit_on_failure?
  true
end

Instance Method Details

#new(name) ⇒ Object



49
50
51
# File 'lib/tumugi/cli.rb', line 49

def new(name)
  generate_plugin(name, options)
end

#run_(task) ⇒ Object



34
35
36
# File 'lib/tumugi/cli.rb', line 34

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

#show(task) ⇒ Object



42
43
44
45
46
# File 'lib/tumugi/cli.rb', line 42

def show(task)
  opts = options.dup
  opts[:quiet] = true if opts[:out].nil?
  execute(:show, task, opts.freeze)
end

#versionObject



25
26
27
# File 'lib/tumugi/cli.rb', line 25

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