Skip to content

Raise error when using o>| pipe - #13323

Merged
fdncred merged 6 commits into
nushell:mainfrom
WindSoilder:out_greater_pipe
Jul 9, 2024
Merged

fdncred merged 6 commits into
nushell:mainfrom
WindSoilder:out_greater_pipe

Conversation

@WindSoilder

Copy link
Copy Markdown
Contributor

Description

From the feedbacks from @amtoine , it's good to make nushell shows error for o>| syntax.

User-Facing Changes

Before

'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

'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

Comment thread crates/nu-parser/src/lex.rs Resolved
@fdncred
fdncred merged commit 1964dac into nushell:main Jul 9, 2024
@fdncred

fdncred commented Jul 9, 2024

Copy link
Copy Markdown
Contributor

Thanks

@amtoine

amtoine commented Jul 9, 2024

Copy link
Copy Markdown
Member

@Turtyo, that ones for you 😉

@amtoine

amtoine commented Jul 9, 2024

Copy link
Copy Markdown
Member

and thanks @WindSoilder 🙏

@Turtyo

Turtyo commented Jul 9, 2024

Copy link
Copy Markdown

@Turtyo, that ones for you 😉

Perfect 👍 it's true that o>| is just stdout but at least it's fool proof now 😆

@hustcer hustcer added this to the v0.96.0 milestone Jul 10, 2024
@WindSoilder
WindSoilder deleted the out_greater_pipe branch July 15, 2024 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants