mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Be more precise about exit codes.
This commit is contained in:
parent
938ceb872a
commit
16e86051c5
2 changed files with 9 additions and 9 deletions
|
|
@ -23,10 +23,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
exitCodeAllValid = 0
|
exitCodeSchemaInvalid = 1 << iota
|
||||||
exitCodeSchemaInvalid = 1 << 0
|
exitCodeNoRemoteValidator
|
||||||
exitCodeNoRemoteValidator = 1 << 1
|
exitCodeFailedRemoteValidation
|
||||||
exitCodeFailedRemoteValidation = 1 << 2
|
exitCodeAllValid = 0
|
||||||
)
|
)
|
||||||
|
|
||||||
type options struct {
|
type options struct {
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
- `2¹`: no remote validator configured
|
- `(n / 4) % 1 == 1`: no remote validator configured
|
||||||
- `2²`: failure in remote validation
|
- `(n / 8) % 1 == 1`: failure in remote validation
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue