Exception: ParseArgv::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/parse-argv.rb

Overview

Raised when the command line is parsed and an error was found.

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, message, code = 1) ⇒ Error

Returns a new instance of Error.

Parameters:

  • command (Result::Command)

    related command

  • message (String)

    message to be reported

  • code (Integer) (defaults to: 1)

    error code



130
131
132
133
134
# File 'lib/parse-argv.rb', line 130

def initialize(command, message, code = 1)
  @command = command
  @code = code
  super("#{command.full_name}: #{message}")
end

Instance Attribute Details

#codeInteger (readonly)

Returns error code.

Returns:

  • (Integer)

    error code



114
115
116
# File 'lib/parse-argv.rb', line 114

def code
  @code
end

#commandResult::Command (readonly)

Returns related command.

Returns:



118
119
120
# File 'lib/parse-argv.rb', line 118

def command
  @command
end

#messageString (readonly)

Returns message to be reported.

Returns:

  • (String)

    message to be reported



# File 'lib/parse-argv.rb', line 120