Skip to content

Commit

Permalink
Use exit code 1 for general errors, fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
koplas committed Dec 16, 2024
1 parent df65ad1 commit bc5d149
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/csaf_validator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

const (
exitCodeSchemaInvalid = 1 << iota
exitCodeSchemaInvalid = 2 << iota
exitCodeNoRemoteValidator
exitCodeFailedRemoteValidation
exitCodeAllValid = 0
Expand Down
7 changes: 4 additions & 3 deletions docs/csaf_validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ is a tool to validate local advisories files against the JSON Schema and an opti
### Exit codes
If no fatal error occurs the program will exit with an exit code `n` with the following conditions:
- `n == 0`: all valid
- `(n / 2) % 1 == 1`: schema validation failed
- `(n / 4) % 1 == 1`: no remote validator configured
- `(n / 8) % 1 == 1`: failure in remote validation
- `(n & 1) > 0`: general error, see logs
- `(n & 2) > 0`: schema validation failed
- `(n & 4) > 0`: no remote validator configured
- `(n & 8) > 0`: failure in remote validation

### Usage

Expand Down

0 comments on commit bc5d149

Please sign in to comment.