Documentation
¶
Index ¶
Constants ¶
View Source
const ( ExitSuccess = 0 // Successful execution ExitError = 1 // Generic/unclassified error ExitUsage = 2 // Invalid usage / flags / command invocation ExitAuth = 3 // Authentication failure (missing, unauthorized, forbidden) ExitNotFound = 4 // Resource not found ExitConflict = 5 // Conflict / resource already exists // HTTP 4xx range: 10 + (status - 400) // Note: 404 and 409 are mapped to ExitNotFound and ExitConflict above. ExitHTTPBadRequest = 10 // 400 ExitHTTPForbidden = 12 // 403 ExitHTTPUnprocessable = 22 // 422 // HTTP 5xx range: 60 + (status - 500) ExitHTTPInternalServer = 60 // 500 ExitHTTPBadGateway = 62 // 502 )
Exit codes following the CI/CD specification.
Variables ¶
This section is empty.
Functions ¶
func APIErrorCodeToExitCode ¶
APIErrorCodeToExitCode maps an API error code string to the appropriate exit code.
func ExitCodeFromError ¶
ExitCodeFromError maps an error to the appropriate exit code. This is the single source of truth for exit code determination.
func HTTPStatusToExitCode ¶
HTTPStatusToExitCode maps an HTTP status code to the appropriate exit code.
func RootCommand ¶
RootCommand returns the root command
func RootUsageFunc ¶
RootUsageFunc renders grouped root help, similar to gh style.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.