Exception: CommandLine::ParametersOutOfRange

Inherits:
Error
  • Object
show all
Defined in:
lib/cli/command_line_arguments.rb

Overview

Missing a required file

Instance Method Summary (collapse)

Constructor Details

- (ParametersOutOfRange) initialize(expected, actual)



275
276
277
278
279
280
281
282
283
284
285
# File 'lib/cli/command_line_arguments.rb', line 275

def initialize(expected, actual)
  if expected.kind_of?(Range)
    if expected.end == CommandLine::Arguments::Definition::ENDLESS_PARAMETERS
      super("The command expected at least #{expected.begin} parameters, but found #{actual}!")
    else
      super("The command expected between #{expected.begin} and #{expected.end} parameters, but found #{actual}!")
    end
  else
    super("The command expected #{expected} parameters, but found #{actual}!")
  end
end