Exception: Homebrew::CLI::MaxNamedArgumentsError

Inherits:
UsageError
  • Object
show all
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(maximum) ⇒ MaxNamedArgumentsError

Returns a new instance of MaxNamedArgumentsError.



456
457
458
459
460
461
462
463
464
465
466
# File 'brew/Library/Homebrew/cli/parser.rb', line 456

def initialize(maximum)
  message = case maximum
  when 0
    "this command does not take named arguments"
  when 1
    "this command does not take multiple named arguments"
  else
    "this command does not take more than #{maximum} named arguments"
  end
  super message
end