1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

add exit codes section

This commit is contained in:
Kelly Brazil
2021-05-11 11:11:17 -07:00
parent 21a15225eb
commit 995ecc9bfb
3 changed files with 15 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -62,6 +62,21 @@ raw JSON output
\fB-v\fP \fB-v\fP
version information version information
.SH EXIT CODES
Any fatal errors within `jc` will generate an exit code of `100`, otherwise the exit code will be `0`. When using the "magic" syntax (e.g. `jc ifconfig eth0`), `jc` will store the exit code of the program being parsed and add it to the `jc` exit code. This way it is easier to tell if an error was from the parsed program or `jc`.
Consider the following examples using `ifconfig`:
.RS
`ifconfig` exit code = `0`, `jc` exit code = `0`, combined exit code = `0` (no errors)
`ifconfig` exit code = `1`, `jc` exit code = `0`, combined exit code = `1` (error in `ifconfig`)
`ifconfig` exit code = `0`, `jc` exit code = `100`, combined exit code = `100` (error in `jc`)
`ifconfig` exit code = `1`, `jc` exit code = `100`, combined exit code = `101` (error in both `ifconfig` and `jc`)
.RE
.SH ENVIRONMENT .SH ENVIRONMENT
You can specify custom colors via the \fBJC_COLORS\fP environment variable. The \fBJC_COLORS\fP environment variable takes four comma separated string values in the following format: You can specify custom colors via the \fBJC_COLORS\fP environment variable. The \fBJC_COLORS\fP environment variable takes four comma separated string values in the following format: