From f36811b7bef5e617ad477b4dbec73854da41d651 Mon Sep 17 00:00:00 2001 From: axel Date: Thu, 20 Jul 2006 09:20:20 +1000 Subject: [PATCH] Improve error message for attempts to use Posix variable assignments darcs-hash:20060719232020-ac50b-1564ffffc2e119e90d711605247637e7aac9da96.gz --- parser.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/parser.c b/parser.c index 188390e53..740e02f60 100644 --- a/parser.c +++ b/parser.c @@ -140,7 +140,7 @@ The fish parser. Contains functions for parsing code. /** Error message for Posix-style assignment */ -#define COMMAND_ASSIGN_ERR_MSG _( L"Unknown command '%ls'. Did you mean 'set VARIABLE VALUE'? For information on setting variable values, see the help section on the set command by typing 'help set'.") +#define COMMAND_ASSIGN_ERR_MSG _( L"Unknown command '%ls'. Did you mean 'set %ls %ls'? For information on assigning values to variables, see the help section on the set command by typing 'help set'.") /** Error for invalid redirection token @@ -2161,7 +2161,7 @@ static int parse_job( process_t *p, wchar_t *cmd = (wchar_t *)al_get( args, 0 ); /* - We couln't find the specified command. + We couldn't find the specified command. What we want to happen now is that the specified job won't get executed, and an @@ -2176,9 +2176,16 @@ static int parse_job( process_t *p, */ if( wcschr( cmd, L'=' ) ) { + wchar_t *cpy = halloc_wcsdup( j, cmd ); + wchar_t *valpart = wcschr( cpy, L'=' ); + *valpart++=0; + debug( 0, COMMAND_ASSIGN_ERR_MSG, - (wchar_t *)al_get( args, 0 ) ); + cmd, + cpy, + valpart); + } else if(cmd[0]==L'$') {