mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 09:27:38 +00:00
STATUS_INVALID_ARGS = 2
The rest of the high-numbered exit codes are not values used by scripts or builtins, they are internal to fish and come out of the parser for example. Prior to adding STATUS_INVALID_ARGS, builtins were usually exiting 2 if they had a special exit status for the situation of bad arguments. Set it to 2.
This commit is contained in:
parent
b404b9392c
commit
cf2b40040a
1 changed files with 5 additions and 5 deletions
10
src/common.h
10
src/common.h
|
@ -1078,9 +1078,13 @@ enum {
|
||||||
STATUS_CMD_OK = 0,
|
STATUS_CMD_OK = 0,
|
||||||
/// The status code used for failure exit in a command (but not if the args were invalid).
|
/// The status code used for failure exit in a command (but not if the args were invalid).
|
||||||
STATUS_CMD_ERROR = 1,
|
STATUS_CMD_ERROR = 1,
|
||||||
|
/// The status code used for invalid arguments given to a command. This is distinct from valid
|
||||||
|
/// arguments that might result in a command failure. An invalid args condition is something
|
||||||
|
/// like an unrecognized flag, missing or too many arguments, an invalid integer, etc. But
|
||||||
|
STATUS_INVALID_ARGS = 2,
|
||||||
|
|
||||||
/// The status code used when a command was not found.
|
/// The status code used when a command was not found.
|
||||||
STATUS_CMD_UNKNOWN = 127,
|
STATUS_CMD_UNKNOWN = 127,
|
||||||
|
|
||||||
/// TODO: Figure out why we have two distinct failure codes for when an external command cannot
|
/// TODO: Figure out why we have two distinct failure codes for when an external command cannot
|
||||||
/// be run.
|
/// be run.
|
||||||
///
|
///
|
||||||
|
@ -1095,10 +1099,6 @@ enum {
|
||||||
STATUS_ILLEGAL_CMD = 123,
|
STATUS_ILLEGAL_CMD = 123,
|
||||||
/// The status code used when `read` is asked to consume too much data.
|
/// The status code used when `read` is asked to consume too much data.
|
||||||
STATUS_READ_TOO_MUCH = 122,
|
STATUS_READ_TOO_MUCH = 122,
|
||||||
/// The status code used for invalid arguments given to a command. This is distinct from valid
|
|
||||||
/// arguments that might result in a command failure. An invalid args condition is something
|
|
||||||
/// like an unrecognized flag, missing or too many arguments, an invalid integer, etc. But
|
|
||||||
STATUS_INVALID_ARGS = 121,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Normally casting an expression to void discards its value, but GCC
|
/* Normally casting an expression to void discards its value, but GCC
|
||||||
|
|
Loading…
Reference in a new issue