Exception: Homebrew::CLI::MinNamedArgumentsError

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(minimum) ⇒ MinNamedArgumentsError

Returns a new instance of MinNamedArgumentsError.



383
384
385
386
387
388
389
390
391
392
393
# File 'brew/Library/Homebrew/cli/parser.rb', line 383

def initialize(minimum)
  message = case minimum
  when 1
    "this command requires a named argument"
  when 2
    "this command requires multiple named arguments"
  else
    "this command requires at least #{minimum} named arguments"
  end
  super message
end