Exception: Homebrew::CLI::MaxNamedArgumentsError
- Inherits:
-
UsageError
- Object
- RuntimeError
- UsageError
- Homebrew::CLI::MaxNamedArgumentsError
- Extended by:
- T::Sig
- Defined in:
- cli/parser.rb
Instance Attribute Summary
Attributes inherited from UsageError
Instance Method Summary collapse
-
#initialize(maximum, types: []) ⇒ void
constructor
Methods inherited from UsageError
Constructor Details
#initialize(maximum, types: []) ⇒ void
670 671 672 673 674 675 676 677 678 679 680 681 |
# File 'cli/parser.rb', line 670 def initialize(maximum, types: []) super case maximum when 0 "This command does not take named arguments." else types << :named if types.empty? arg_types = types.map { |type| type.to_s.tr("_", " ") } .to_sentence two_words_connector: " or ", last_word_connector: " or " "This command does not take more than #{maximum} #{arg_types} #{"argument".pluralize(maximum)}." end end |