Exception: GLI::CommandException

Inherits:
BadCommandLine show all
Defined in:
lib/gli/exceptions.rb

Direct Known Subclasses

UnknownCommandArgument

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, command_in_context, exit_code = nil) ⇒ CommandException

message

the error message to show the user

command

the command we were using to parse command-specific options



31
32
33
34
35
# File 'lib/gli/exceptions.rb', line 31

def initialize(message,command_in_context,exit_code=nil)
  super(message)
  @command_in_context = command_in_context
  @exit_code = exit_code
end

Instance Attribute Details

#command_in_contextObject (readonly)

The command for which the argument was unknown



28
29
30
# File 'lib/gli/exceptions.rb', line 28

def command_in_context
  @command_in_context
end

Instance Method Details

#exit_codeObject



37
38
39
# File 'lib/gli/exceptions.rb', line 37

def exit_code
  @exit_code || super
end