Exception: Homebrew::CLI::NamedArgumentsError

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) ⇒ NamedArgumentsError

Returns a new instance of NamedArgumentsError.



314
315
316
317
318
319
320
321
322
323
324
# File 'brew/Library/Homebrew/cli/parser.rb', line 314

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