mkit_cli/exit.rs
1//! sysexits(3)-style exit codes for the mkit CLI.
2//!
3//! Shell scripts that pipe `mkit ... || handle` use `$?` to distinguish
4//! usage errors from transient transport failures. See `docs/CLI.md`
5//! §"Exit codes" for the documented contract.
6
7/// Successful termination.
8pub const OK: u8 = 0;
9
10/// Catch-all for errors that do not fit a more specific category.
11pub const GENERAL_ERROR: u8 = 1;
12
13/// Wrong args or unknown subcommand.
14pub const USAGE: u8 = 64;
15
16/// Malformed input — corrupt object, bad hash literal on the CLI, etc.
17pub const DATAERR: u8 = 65;
18
19/// Input file does not exist or is unreadable.
20pub const NOINPUT: u8 = 66;
21
22/// Transport could not connect.
23pub const UNAVAILABLE: u8 = 69;
24
25/// Cannot create an output file.
26pub const CANTCREAT: u8 = 73;
27
28/// Temporary failure; retry is safe.
29pub const TEMPFAIL: u8 = 75;
30
31/// Bad URL scheme or malformed server response.
32pub const PROTOCOL_ERROR: u8 = 76;
33
34/// Permission denied.
35pub const NOPERM: u8 = 77;
36
37/// Unknown config key or invalid config value.
38pub const CONFIG_ERROR: u8 = 78;