Class: SystemdServiceCheck::CLI

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

Overview

CLI

Defined Under Namespace

Classes: InvalidFormatOptionError

Instance Method Summary collapse

Instance Method Details

#check(*envs) ⇒ Object

rubocop:disable Metrics/AbcSize:



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/systemd_service_check/cli.rb', line 35

def check(*envs) # rubocop:disable Metrics/AbcSize:
  raise InvalidFormatOptionError unless format_option_validate

  @ssc = Base.new(envs, options[:yaml], options[:role])
  @ssc.run
  disp
rescue InvalidFormatOptionError => e
  puts "<#{e}>",
       "  [#{options[:format]}] is invalid value."
  puts "  #{e.backtrace_locations.first}"
end

#versionObject



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

def version
  puts VERSION
end