lib/invoker/cli.rb in invoker-1.5.3 vs lib/invoker/cli.rb in invoker-1.5.4

- old
+ new

@@ -35,14 +35,19 @@ option :port, type: :numeric, banner: "Port series to be used for starting rack servers" option :daemon, type: :boolean, banner: "Daemonize the server into the background", aliases: [:d] + option :nocolors, + type: :boolean, + banner: "Disable color in output", + aliases: [:nc] def start(file = nil) Invoker.setup_config_location port = options[:port] || 9000 Invoker.daemonize = options[:daemon] + Invoker.nocolors = options[:nocolors] 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".color(:red)) if pinger.invoker_running? @@ -78,12 +83,20 @@ signal = options[:signal] || 'INT' unix_socket.send_command('reload', process_name: name, signal: signal) end desc "list", "List all running processes" + option :raw, + type: :boolean, + banner: "Print process list in raw text format", + aliases: [:r] def list unix_socket.send_command('list') do |response_object| - Invoker::ProcessPrinter.new(response_object).tap { |printer| printer.print_table } + if options[:raw] + Invoker::ProcessPrinter.new(response_object).tap { |printer| printer.print_raw_text } + else + Invoker::ProcessPrinter.new(response_object).tap { |printer| printer.print_table } + end end end desc "remove process", "Stop a process managed by Invoker" option :signal,