mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Improve error message for $?
This commit is contained in:
parent
24059924b1
commit
73e56527bf
1 changed files with 6 additions and 1 deletions
|
@ -51,6 +51,11 @@ parameter expansion.
|
|||
*/
|
||||
#define COMPLETE_VAR_DESC _( L"The '$' character begins a variable name. The character '%lc', which directly followed a '$', is not allowed as a part of a variable name, and variable names may not be zero characters long. To learn more about variable expansion in fish, type 'help expand-variable'.")
|
||||
|
||||
/**
|
||||
Error issued on $?
|
||||
*/
|
||||
#define COMPLETE_YOU_WANT_STATUS _( L"$? is not a valid variable in fish. If you want the exit status of the last command, try $status.")
|
||||
|
||||
/**
|
||||
Error issued on invalid variable name
|
||||
*/
|
||||
|
@ -724,7 +729,7 @@ void expand_variable_error( parser_t &parser, const wchar_t *token, int token_po
|
|||
|
||||
parser.error( SYNTAX_ERROR,
|
||||
error_pos,
|
||||
COMPLETE_VAR_DESC,
|
||||
(token_stop_char == L'?' ? COMPLETE_YOU_WANT_STATUS : COMPLETE_VAR_DESC),
|
||||
token_stop_char );
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue