Sha256: 1b35e3cd151b795eb53c623746c878083836be86ec06dc5bf2561372584519be

Contents?: true

Size: 601 Bytes

Versions: 3

Compression:

Stored size: 601 Bytes

Contents

module CLAide

  # Including this module into an exception class will ensure that when raised,
  # while running {Command.run}, only the message of the exception will be
  # shown to the user. Unless disabled with the `--verbose` flag.
  #
  # In addition, the message will be colored red, if {Command.colorize_output}
  # is set to `true`.
  #
  module InformativeError

    # @return [Numeric] The exist status code that should be used to terminate
    #         the program with. Defaults to `1`.
    #
    attr_accessor :exit_status

    def exit_status
      @exit_status ||= 1
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
claide-0.4.0 lib/claide/informative_error.rb
claide-0.3.2 lib/claide/informative_error.rb
claide-0.3.1 lib/claide/informative_error.rb