From 5b5f1d1b92f0adf5ca235e850aed0d92c44ce88e Mon Sep 17 00:00:00 2001 From: JT <547158+jntrnr@users.noreply.github.com> Date: Tue, 13 Dec 2022 11:31:03 +1300 Subject: [PATCH] Add pipeline operators to help (#7449) # Description _(Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes.)_ _(Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience.)_ # User-Facing Changes _(List of all changes that impact the user experience here. This helps us keep track of breaking changes.)_ # Tests + Formatting Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --- .../src/core_commands/help_operators.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/nu-command/src/core_commands/help_operators.rs b/crates/nu-command/src/core_commands/help_operators.rs index fcbbeeabd..7bda51e20 100644 --- a/crates/nu-command/src/core_commands/help_operators.rs +++ b/crates/nu-command/src/core_commands/help_operators.rs @@ -312,6 +312,24 @@ fn generate_operator_info() -> Vec { description: "Checks if one value is true and the other is false.".into(), precedence: 45, }, + OperatorInfo { + op_type: "Pipeline".into(), + operator: "&&".into(), + name: "PipelineAnd".into(), + description: + "Runs the pipeline on the left and, if successful, runs pipeline on the right." + .into(), + precedence: 0, + }, + OperatorInfo { + op_type: "Pipeline".into(), + operator: "||".into(), + name: "PipelineOr".into(), + description: + "Runs the pipeline on the left and, if it failed, runs pipeline on the right." + .into(), + precedence: 0, + }, ] }