Sha256: 3b6dc6b98bc245c319a5fe1d97753b178d64d4b1331d7e38a5733baeb227b13a

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 KB

Contents

module Domainic
  module Command
    class Result
      # Defines status codes for command execution results. These codes follow Unix exit code conventions,
      # making them suitable for CLI applications while remaining useful for other contexts.
      #
      # The status codes are specifically chosen to provide meaningful feedback about where in the command
      # lifecycle a failure occurred:
      # * 0 (SUCCESS) - The command completed successfully
      # * 1 (FAILED_AT_RUNTIME) - The command failed during execution
      # * 2 (FAILED_AT_INPUT) - The command failed during input validation
      # * 3 (FAILED_AT_OUTPUT) - The command failed during output validation
      #
      # @example Using with CLI
      #   class MyCLI
      #     def self.run
      #       result = MyCommand.call(args)
      #       exit(result.status_code)
      #     end
      #   end
      #
      # @author {https://aaronmallen.me Aaron Allen}
      # @since 0.1.0
      module STATUS
        # Indicates successful command execution
        #
        # @return [Integer] status code 0
        SUCCESS: Integer

        # Indicates a failure during command execution
        #
        # @return [Integer] status code 1
        FAILED_AT_RUNTIME: Integer

        # Indicates a failure during input validation
        #
        # @return [Integer] status code 2
        FAILED_AT_INPUT: Integer

        # Indicates a failure during output validation
        #
        # @return [Integer] status code 3
        FAILED_AT_OUTPUT: Integer
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
domainic-command-0.1.0 sig/domainic/command/result/status.rbs