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

Extended by:
Utils::Output::Mixin
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

Methods included from Utils::Output::Mixin

odebug, odeprecated, odie, odisabled, ofail, oh1, oh1_title, ohai, ohai_title, onoe, opoo, opoo_outside_github_actions, pretty_duration, pretty_installed, pretty_outdated, pretty_uninstalled

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)


17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'services/commands/list.rb', line 17

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