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

Relax groups and blocks to output at pipeline level #3643

Merged
merged 2 commits into from
Jun 18, 2021

Conversation

sophiajt
Copy link
Contributor

This PR does a few things:

  • it relaxes the redirection in blocks. This allows you to run commands that use interaction in a block. For example, this would now work:
do {
  vim
  echo done
}
  • Treats ; as equivalent to carriage return in source code. That means that:
echo hello; echo world

would be equivalent to:

echo hello
echo world

Taken together you, can rewrite the first example as:

do { vim; echo done }
  • To get the old ignore behaviour in some form, I added an ignore command. You can pipe to this command, and it will drain the stream and not output anything.
autoenv trust foo | ignore

I also went ahead and cleaned up a bad external arg error to be a little less bad.

@sophiajt sophiajt changed the title Looser blocks Relax groups and blocks to output at pipeline level Jun 17, 2021
@sophiajt sophiajt merged commit fe5055c into nushell:main Jun 18, 2021
@sophiajt sophiajt deleted the looser_blocks branch June 18, 2021 01:04
}

fn examples(&self) -> Vec<Example> {
vec![Example {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lolol I put the sample in the description instead of where it should go. I'll fix it

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.

2 participants