Makes a more helpful error for let in pipeline (#5632)

* a more helpful error for let in pipeline

* a more helpful error for let in pipeline fmt

* changed help message

* type-o

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
This commit is contained in:
pwygab
2022-05-26 08:13:14 +08:00
committed by GitHub
parent a42d419b66
commit 3d62528d8c
2 changed files with 17 additions and 1 deletions

View File

@ -4371,7 +4371,12 @@ pub fn parse_expression(
expand_aliases_denylist,
)
.0,
Some(ParseError::BuiltinCommandInPipeline("let".into(), spans[0])),
Some(ParseError::LetInPipeline(
String::from_utf8_lossy(working_set.get_span_contents(spans[spans.len() - 1]))
.to_string(),
String::from_utf8_lossy(working_set.get_span_contents(spans[1])).to_string(),
spans[0],
)),
),
b"alias" => (
parse_call(