lib/invoker/cli.rb in invoker-1.5.6 vs lib/invoker/cli.rb in invoker-1.5.7
- old
+ new
@@ -17,10 +17,11 @@
type: :string,
banner: 'Configure invoker to use a different top level domain'
def setup
Invoker::Power::Setup.install(get_tld(options))
end
+ map install: :setup
desc "version", "Print Invoker version"
def version
Invoker::Logger.puts Invoker::VERSION
end
@@ -54,11 +55,10 @@
Invoker.nocolors = options[:nocolors]
Invoker.certificate = options[:certificate]
Invoker.private_key = options[:private_key]
Invoker.load_invoker_config(file, port)
warn_about_notification
- warn_about_old_configuration
pinger = Invoker::CLI::Pinger.new(unix_socket)
abort("Invoker is already running".colorize(:red)) if pinger.invoker_running?
Invoker.commander.start_manager
end
@@ -89,10 +89,11 @@
aliases: [:s]
def reload(name)
signal = options[:signal] || 'INT'
unix_socket.send_command('reload', process_name: name, signal: signal)
end
+ map restart: :reload
desc "list", "List all running processes"
option :raw,
type: :boolean,
banner: "Print process list in raw text format",
@@ -129,11 +130,11 @@
!command_name.match(/^-/) &&
!valid_tasks.include?(command_name)
end
def self.valid_tasks
- tasks.keys + ["help"]
+ tasks.keys + %w(help install restart)
end
# TODO(kgrz): the default TLD option is duplicated in both this file and
# lib/invoker.rb May be assign this to a constant?
def get_tld(options)
@@ -168,15 +169,9 @@
command_path = `which terminal-notifier`
if !command_path || command_path.empty?
Invoker::Logger.puts "You can enable OSX notification for processes "\
"by installing terminal-notifier gem".colorize(:red)
end
- end
- end
-
- def warn_about_old_configuration
- Invoker::Power::PfMigrate.new.tap do |pf_migrator|
- pf_migrator.migrate
end
end
end
end