Exception: Tomo::CLI::Error

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

Direct Known Subclasses

InterruptedError

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Error

raise_with

Methods included from Tomo::Colors

enabled?

Instance Attribute Details

#command_nameObject

Returns the value of attribute command_name.



6
7
8
# File 'lib/tomo/cli/error.rb', line 6

def command_name
  @command_name
end

Instance Method Details

#to_consoleObject



8
9
10
11
12
13
14
15
# File 'lib/tomo/cli/error.rb', line 8

def to_console
  tomo_command = ["tomo", command_name].compact.join(" ")
  <<~ERROR
    #{message}

    Run #{blue("#{tomo_command} -h")} for help.
  ERROR
end