abbr -e: use same exit code as set -e if abbr doesn't exist

Which is 4, apparently.. (builtin_set.cpp returns ENV_NOT_FOUND)
here. This was previously hardcoded to our 121, which used to be
what builtins used for invalid arguments.

4 is pretty arbitrary but at least this is more consistent.
This commit is contained in:
Aaron Gyes 2019-01-11 00:50:01 -08:00
parent 6ea7aa8a00
commit 6c9065e9ef

View file

@ -102,7 +102,7 @@ function __fish_abbr_erase --no-scope-shadowing
if not set -q $abbr_var_name
printf ( _ "%s %s: No abbreviation named %s\n" ) abbr --erase $escaped_name >&2
return 121
return 4 # like `set -e doesnt_exist`
end
set -e $abbr_var_name