Class: Naginata::CLI
- Inherits:
-
Thor
- Object
- Thor
- Naginata::CLI
show all
- Defined in:
- lib/naginata/cli.rb
Defined Under Namespace
Classes: ActiveCheck, Fetch, Hosts, Init, LocalAbstract, Notification, RemoteAbstract, Services
Instance Method Summary
collapse
Instance Method Details
#activecheck(*patterns) ⇒ Object
52
53
54
55
56
57
58
59
|
# File 'lib/naginata/cli.rb', line 52
def activecheck(*patterns)
if patterns.empty? and options.empty?
help(:activecheck)
exit(1)
end
require 'naginata/cli/active_check'
CLI::ActiveCheck.new(options.merge(patterns: patterns)).execute
end
|
#fetch ⇒ Object
63
64
65
66
|
# File 'lib/naginata/cli.rb', line 63
def fetch
require 'naginata/cli/fetch'
CLI::Fetch.new(options).execute
end
|
#hosts(*patterns) ⇒ Object
72
73
74
75
76
77
78
79
|
# File 'lib/naginata/cli.rb', line 72
def hosts(*patterns)
if patterns.empty? and !options[:all_hosts]
help(:hosts)
exit(1)
end
require 'naginata/cli/hosts'
CLI::Hosts.new(options.merge(patterns: patterns)).execute
end
|
#init ⇒ Object
22
23
24
25
|
# File 'lib/naginata/cli.rb', line 22
def init
require 'naginata/cli/init'
CLI::Init.new(options).execute
end
|
#notification(*patterns) ⇒ Object
35
36
37
38
39
40
41
42
|
# File 'lib/naginata/cli.rb', line 35
def notification(*patterns)
if patterns.empty? and options.empty?
help(:notification)
exit(1)
end
require 'naginata/cli/notification'
CLI::Notification.new(options.merge(patterns: patterns)).execute
end
|
#services(*patterns) ⇒ Object
86
87
88
89
90
91
92
93
|
# File 'lib/naginata/cli.rb', line 86
def services(*patterns)
if patterns.empty? and !options[:all_hosts]
help(:services)
exit(1)
end
require 'naginata/cli/services'
CLI::Services.new(options.merge(patterns: patterns)).execute
end
|
#version ⇒ Object
15
16
17
18
|
# File 'lib/naginata/cli.rb', line 15
def version
require 'naginata/version'
Naginata.ui.info "Naginata version #{Naginata::VERSION}"
end
|