mirror of
https://github.com/nushell/nushell.git
synced 2025-08-18 09:19:53 +02:00
Raise error when using o>|
pipe (#13323)
# Description From the feedbacks from @amtoine , it's good to make nushell shows error for `o>|` syntax. # User-Facing Changes ## Before ```nushell 'foo' o>| print 07/09/2024 06:44:23 AM Error: nu::parser::parse_mismatch × Parse mismatch during operation. ╭─[entry #6:1:9] 1 │ 'foo' o>| print · ┬ · ╰── expected redirection target ``` ## After ```nushell 'foo' o>| print 07/09/2024 06:47:26 AM Error: nu::parser::parse_mismatch × Parse mismatch during operation. ╭─[entry #1:1:7] 1 │ 'foo' o>| print · ─┬─ · ╰── expected `|`. Redirection stdout to pipe is the same as piping directly. ╰──── ``` # Tests + Formatting Added one test --------- Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
This commit is contained in:
@@ -1161,3 +1161,11 @@ fn command_not_found_error_shows_not_found_2() {
|
||||
&& actual.err.contains("Did you mean `for`?")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn error_on_out_greater_pipe() {
|
||||
let actual = nu!(r#""foo" o>| print"#);
|
||||
assert!(actual
|
||||
.err
|
||||
.contains("Redirecting stdout to a pipe is the same as normal piping"))
|
||||
}
|
||||
|
Reference in New Issue
Block a user