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.



393
394
395
396
397
398
399
400
401
402
403
# File 'brew/Library/Homebrew/cli/parser.rb', line 393

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