Exception: Homebrew::CLI::MinNamedArgumentsError Private

Inherits:
UsageError show all
Defined in:
cli/error.rb

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

Instance Attribute Summary

Attributes inherited from UsageError

#reason

Instance Method Summary collapse

Constructor Details

#initialize(minimum, types: []) ⇒ 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.

Parameters:



57
58
59
60
61
62
63
64
65
# File 'cli/error.rb', line 57

def initialize(minimum, types: [])
  types << :named if types.empty?
  arg_types = Utils::Text.to_sentence(
    types.map { |type| type.to_s.tr("_", " ") },
    conjunction: "or",
  )

  super "This command requires at least #{minimum} #{arg_types} #{Utils.pluralize("argument", minimum)}."
end