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.



369
370
371
372
373
374
375
376
377
378
379
# File 'brew/Library/Homebrew/cli/parser.rb', line 369

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