1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +01:00

Be more precise about exit codes.

This commit is contained in:
Sascha L. Teichmann 2024-12-04 14:27:24 +01:00
parent 938ceb872a
commit 16e86051c5
2 changed files with 9 additions and 9 deletions

View file

@ -23,10 +23,10 @@ import (
) )
const ( const (
exitCodeSchemaInvalid = 1 << iota
exitCodeNoRemoteValidator
exitCodeFailedRemoteValidation
exitCodeAllValid = 0 exitCodeAllValid = 0
exitCodeSchemaInvalid = 1 << 0
exitCodeNoRemoteValidator = 1 << 1
exitCodeFailedRemoteValidation = 1 << 2
) )
type options struct { type options struct {

View file

@ -3,11 +3,11 @@
is a tool to validate local advisories files against the JSON Schema and an optional remote validator. is a tool to validate local advisories files against the JSON Schema and an optional remote validator.
### Exit codes ### Exit codes
If no fatal error occurs the program will exit with the following codes: If no fatal error occurs the program will exit with an exit code `n` with the following conditions:
- `0`: all valid - `n == 0`: all valid
- `2⁰`: schema invalid - `(n / 2) % 1 == 1`: schema validation failed
- ``: no remote validator configured - `(n / 4) % 1 == 1`: no remote validator configured
- ``: failure in remote validation - `(n / 8) % 1 == 1`: failure in remote validation
### Usage ### Usage