Module: Homebrew::Services::Commands::List Private

Defined in:
services/commands/list.rb

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Constant Summary collapse

TRIGGERS =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

[nil, "list", "ls"].freeze
JSON_FIELDS =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

[:name, :status, :user, :file, :exit_code].freeze

Class Method Summary collapse

Class Method Details

.run(json: false) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:

  • json (Boolean) (defaults to: false)


14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'services/commands/list.rb', line 14

def self.run(json: false)
  formulae = Formulae.services_list
  if formulae.blank?
    opoo "No services available to control with `#{Services::Cli.bin}`" if $stderr.tty?
    return
  end

  if json
    print_json(formulae)
  else
    print_table(formulae)
  end
end