Exception: Homebrew::CLI::MinNamedArgumentsError

Inherits:
UsageError
  • Object
show all
Extended by:
T::Sig
Defined in:
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: [])


691
692
693
694
695
696
697
# File 'cli/parser.rb', line 691

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 at least #{minimum} #{arg_types} #{"argument".pluralize(minimum)}."
end