Exception: Homebrew::CLI::NumberOfNamedArgumentsError

Inherits:
UsageError
  • Object
show all
Extended by:
T::Sig
Defined in:
brew/Library/Homebrew/cli/parser.rb

Instance Attribute Summary

Attributes inherited from UsageError

#reason

Instance Method Summary collapse

Methods inherited from UsageError

#to_s

Constructor Details

#initialize(minimum, types: []) ⇒ void

Parameters:

  • minimum (Integer)
  • types (Array<Symbol>) (defaults to: [])


716
717
718
719
720
721
722
# File 'brew/Library/Homebrew/cli/parser.rb', line 716

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

  super "This command requires exactly #{minimum} #{arg_types} #{"argument".pluralize(minimum)}."
end