From eb28c710baa385cbd9b979e99736ef65b16de0db Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 13 Jan 2014 12:51:09 -0800 Subject: [PATCH] Improve the 'This command can not be used in a pipeline' message to actually name the command --- parse_util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parse_util.cpp b/parse_util.cpp index 027a0e9bf..eded7b93f 100644 --- a/parse_util.cpp +++ b/parse_util.cpp @@ -44,7 +44,7 @@ /** Error message for improper use of the exec builtin */ -#define EXEC_ERR_MSG _(L"This command can not be used in a pipeline") +#define EXEC_ERR_MSG _(L"The '%ls' command can not be used in a pipeline") int parse_util_lineno(const wchar_t *str, size_t offset) { @@ -1035,7 +1035,7 @@ parser_test_error_bits_t parse_util_detect_errors(const wcstring &buff_src, pars // 'or' and 'and' can be first in the pipeline. forbidden commands cannot be in a pipeline at all if (node_tree.plain_statement_is_in_pipeline(node, is_pipe_forbidden)) { - errored = append_syntax_error(&parse_errors, node, EXEC_ERR_MSG); + errored = append_syntax_error(&parse_errors, node, EXEC_ERR_MSG, command.c_str()); } }