Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise error when using o>| pipe #13323

Merged
merged 6 commits into from
Jul 9, 2024
Merged

Conversation

WindSoilder
Copy link
Collaborator

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

crates/nu-parser/src/lex.rs Outdated Show resolved Hide resolved
WindSoilder and others added 2 commits July 9, 2024 09:02
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
@fdncred fdncred merged commit 1964dac into nushell:main Jul 9, 2024
13 checks passed
@fdncred
Copy link
Collaborator

fdncred commented Jul 9, 2024

Thanks

@amtoine
Copy link
Member

amtoine commented Jul 9, 2024

@Turtyo, that ones for you 😉

@amtoine
Copy link
Member

amtoine commented Jul 9, 2024

and thanks @WindSoilder 🙏

@Turtyo
Copy link

Turtyo commented Jul 9, 2024

@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