@@ -784,397 +784,3 @@ POSIX XDG conventions:
784784* `XDG_STATE_HOME` => user-specific cache files, analogous to system /var/state or $HOME/.local/state.
785785* `XDG_CONFIG_HOME` => user-specific configuration files, analogous to system /etc or $HOME/.config.
786786* `XDG_RUNTIME_HOME` => user-specific runtime files such as sockets, named pipes, etc. or $HOME/.runtime.
787-
788- ## Exit codes
789-
790- Our POSIX shell programs call "exit" with an exit code value.
791-
792- Conventions:
793-
794- * 0 = success, and non-zero indicates any other issue.
795-
796- * 1 = failure
797-
798- * 2 = failure due to a usage problem
799-
800- * 3-63 are for a program' s progam-specific exit codes.
801-
802- * 64-78 are based on sysexits documentation from the 1980' s.
803-
804- * 80-119 are SixArm conventions that we find useful in many programs.
805-
806- Many POSIX shells use exit code 126 and 127 to signal specific error status:
807- 126 is for command found but not executable, and 127 is for command not found.
808-
809- * 126 is for the shell and indicates command found but not executable.
810-
811- * 127 is for the shell and indicate command not found.
812-
813- Many POSIX shells use exit codes above 128 in their $? representation of the
814- exit status to encode the signal number of a process being killed.
815-
816- The pre-defined exit codes from sysexits can be used, so the caller of the
817- process can get a rough estimation about the failure class without looking up
818- the source code.
819-
820- See https://man.openbsd.org/sysexits.3
821-
822- We recommend:
823-
824- * Authentication issues: EXIT_NOUSER
825-
826- * Authoriziation issues: EXIT_NOPERM
827-
828- The exit code list below is subject to change over time, as we learn more.
829-
830-
831- ### Success
832-
833- ```sh
834- EXIT_SUCCESS=0
835- ```
836-
837- The program succeeded.
838-
839- Exit 0 meaning success is a widespread convention as a catch-all code.
840-
841-
842- ### Failure
843-
844- ```sh
845- EXIT_FAILURE=1
846- ```
847-
848- The program failed.
849-
850- E.g. an error, an abort, found no results, lack of data, etc.
851-
852- Exit 1 meaning failure is a widespread convention as a catch-all code.
853-
854-
855- ### Usage
856-
857- ```sh
858- EXIT_USAGE=2
859- ```
860-
861- The program usage is incorrect, or malformed, or in conflict, etc.
862-
863- E.g. wrong number of args, a bad flag, a syntax error in an option, etc.
864-
865- Exit 2 meaning usage is a widespread convention as a catch-all CLI code.
866-
867-
868- ### Data Err
869-
870- ```sh
871- EXIT_DATAERR=65
872- ```
873-
874- The input data was incorrect in some way. This should only be used
875- for user' s data and not system files.
876-
877-
878- # ## No Input
879-
880- An input file-- not system file-- did not exist or was not readable.
881- This could include errors like " No message" to a mailer, if it cared about it.
882-
883- ` ` ` sh
884- EXIT_NOINPUT=66
885- ` ` `
886-
887- # ## No User
888-
889- ` ` ` sh
890- EXIT_NOUSER=67
891- ` ` `
892-
893- The user specified did not exist.
894-
895- This might be used for mail addresses or remote logins, or when authentication is required.
896-
897-
898- # ## No Host
899-
900- ` ` ` sh
901- EXIT_NOHOST=68
902- ` ` `
903-
904- The host specified did not exist. This is used in mail addresses or
905- network requests.
906-
907-
908- # ## Unavailable
909-
910- ` ` ` sh
911- EXIT_UNAVAILABLE=69
912- ` ` `
913-
914- A service is unavailable. This can occur if a support program or
915- file does not exist. This can also be used as a catchall message when
916- something you wanted to do does not work, but you do not know why.
917-
918-
919- # ## Software
920-
921- ` ` ` sh
922- EXIT_SOFTWARE=70
923- ` ` `
924-
925- An internal software error has been detected. This should be limited
926- to non-operating system related errors as possible.
927-
928-
929- # ## OS Err
930-
931- ` ` ` sh
932- EXIT_OSERR=71
933- ` ` `
934-
935- An operating system error has been detected. This is intended for such
936- things as " cannot fork" , " cannot create pipe" , or the like. It includes
937- things like getuid returning a user that does not exist in the passwd file.
938-
939-
940- # ## OS File
941-
942- An operating system file (e.g. /etc/passwd) does not exist, or cannot
943- be opened, or has some sort of error (e.g. syntax error).
944-
945- ` ` ` sh
946- EXIT_OSFILE=72
947- ` ` `
948-
949- # ## Can't Create
950-
951- ` ` ` sh
952- EXIT_CANTCREATE=73
953- ` ` `
954-
955- A user-specified output (e.g. a file) cannot be created.
956-
957-
958- # ## IO Err
959-
960- An error occurred while doing I/O on some file.
961-
962- ` ` ` sh
963- EXIT_IOERR=74
964- ` ` `
965-
966- # ## Temp Fail
967-
968- ` ` ` sh
969- EXIT_TEMPFAIL=75
970- ` ` `
971-
972- A temporary failure occurred; this is not a permanent error.
973-
974- E.g. a mailer could not create a connection. The request can be retried later.
975-
976-
977- # ## Protocol
978-
979- ` ` ` sh
980- EXIT_PROTOCOL=76
981- ` ` `
982-
983- The remote system returned something that was " not possible" during
984- a protocol exchange.
985-
986-
987- # ## No Perm
988-
989- ` ` ` sh
990- EXIT_NOPERM=77
991- ` ` `
992-
993- You did not have sufficient permission to perform the operation. This
994- is not for file system problems, which use EXIT_NOINPUT or EXIT_CANTCREATE,
995- but rather for higher level permissions, access control authorization, etc.
996-
997-
998- # ## Config
999-
1000- ` ` ` sh
1001- EXIT_CONFIG=78
1002- ` ` `
1003-
1004- Something was found in an unconfigured or misconfigured state.
1005-
1006-
1007- # ## Exit codes 80-119
1008-
1009- Exit codes 80-119 are for our own SixArm conventions.
1010-
1011- We propose these are generally useful to many kinds of programs.
1012-
1013- Caution: these exit codes and their values are work in progress,
1014- draft only, as a request for comments, in version 11.x of this file.
1015- These exit codes will be set in version 12.x when it' s released.
1016-
1017- * 80+ for user interation issues
1018-
1019- * 90+ for access control issues
1020-
1021- * 100+: process runtime issues
1022-
1023- * 110+: expected ability issues
1024-
1025- ### Quit
1026-
1027- ```sh
1028- EXIT_QUIT=80
1029- ```
1030-
1031- The user chose to quit, or cancel, or abort, or not continue, etc.
1032-
1033-
1034- ### KYC
1035-
1036- ```sh
1037- EXIT_KYC=81
1038- ```
1039-
1040- Know Your Customer means the program requires more user information.
1041- E.g. email validation, age verification, terms of service agreement, etc.
1042-
1043-
1044- ### Update
1045-
1046- ```sh
1047- EXIT_UPDATE=82
1048- ```
1049-
1050- The program or its dependencies need an update, or upgrade, etc.
1051-
1052-
1053- ### Conflict
1054-
1055- ```sh
1056- EXIT_CONFLICT=91
1057- ```
1058-
1059- An item has a conflict e.g. edit collision, or merge error, etc.
1060-
1061- Akin to HTTP status code 409 Conflict.
1062-
1063-
1064- ### Unlawful
1065-
1066- ```sh
1067- EXIT_UNLAWFUL=92
1068- ```
1069-
1070- E.g. prohibited due to law, or warrant, or court order, etc.
1071-
1072- Akin to HTTP status code 451 Unavailable For Legal Reasons (RFC 7725).
1073-
1074-
1075- ### Payment Issue
1076-
1077- ```sh
1078- EXIT_PAYMENT_ISSUE=93
1079- ```
1080-
1081- E.g. needs a credit card, or invoice, or billing, etc.
1082-
1083- Akin to HTTP status code 402 Payment Required.
1084-
1085-
1086- ### Busy
1087-
1088- ```sh
1089- EXIT_BUSY=100
1090- ```
1091-
1092- A process is too busy, or overloaded, or throttled, or breakered, etc.
1093-
1094- Akin to HTTP status code 503 Service Unavailable; always means overloaded.
1095-
1096-
1097- ### Timeout
1098-
1099- ```sh
1100- EXIT_TIMEOUT=101
1101- ```
1102-
1103- A process is too slow, or estimated to take too long, etc.
1104-
1105- Akin to HTTP status code 408 Request Timeout.
1106-
1107-
1108- ### Lockout
1109-
1110- ```sh
1111- EXIT_LOCKOUT=102
1112- ```
1113-
1114- A process is intentionally blocked as a danger, hazard, risk, etc.
1115-
1116- This is for lockout-tagout (LOTO) safety, or protecting users or data, etc.
1117-
1118-
1119- ### Loop
1120-
1121- ```sh
1122- EXIT_LOOP=103
1123- ```
1124-
1125- A process has detected an infinite loop, so is aborting.
1126-
1127- Akin to HTTP status code 508 Loop Detected.
1128-
1129-
1130- ### Gone
1131-
1132- ```sh
1133- EXIT_GONE=110
1134- ```
1135-
1136- An expected ability has been intentionally removed, or deleted, etc.
1137-
1138- Akin to HTTP status code 410 Gone; the ability should be purged.
1139-
1140-
1141- ### TODO
1142-
1143- ```sh
1144- EXIT_TODO=111
1145- ```
1146-
1147- An expected ability is not yet implemented, or work in progress, etc.
1148-
1149- Akin to HTTP status code 501 Not Implemented; implies future availability.
1150-
1151-
1152- ### Git bisect skip
1153-
1154- ```sh
1155- EXIT_GIT_BISECT_SKIP=125
1156- ```
1157-
1158- Git bisect: The special exit code 125 should be used when the current source
1159- code cannot be tested. If the script exits with this code, the current
1160- revision will be skipped (see git bisect skip above). 125 was chosen as the
1161- highest sensible value to use for this purpose, because 126 and 127 are used
1162- by POSIX shells to signal specific error status; see below for details.
1163-
1164-
1165- ### Command found but not executable
1166-
1167- ```sh
1168- EXIT_COMMAND_FOUND_BUT_NOT_EXECUTABLE=126
1169- ```
1170-
1171- A command is found but is not executable.
1172-
1173-
1174- ### Command not found
1175-
1176- ```sh
1177- EXIT_COMMAND_NOT_FOUND=127
1178- ```
1179-
1180- A command is not found.
0 commit comments