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

The explanation is identical for two pipeline chain operators #82

Closed
LaurentDardenne opened this issue Jul 1, 2022 · 1 comment
Closed
Labels
good first issue Good for newcomers

Comments

@LaurentDardenne
Copy link

With :

dir||Cls ; dir&&Cls

Result :
image

According to this documentation :
The && operator executes the right-hand pipeline, if the left-hand pipeline succeeded.
Conversely, the || operator executes the right-hand pipeline if the left-hand pipeline failed.

@Jawz84 Jawz84 added the good first issue Good for newcomers label Jul 1, 2022
@Jawz84
Copy link
Owner

Jawz84 commented Jul 1, 2022

A great catch! This can be fixed here:

public override AstVisitAction VisitPipelineChain(PipelineChainAst statementChain)
{
var operatorString = statementChain.Operator.ToString() == "AndAnd" ? "&&" : "||";
explanations.Add(new Explanation()
{
Description = $"The '{operatorString}' operator executes the right-hand pipeline, if the left-hand pipeline succeeded.",
CommandName = "Pipeline chain",
HelpResult = HelpTableQuery("about_Pipeline_Chain_Operators"),
TextToHighlight = operatorString
}.AddDefaults(statementChain, explanations));
return base.VisitPipelineChain(statementChain);
}

If you like, you are more than welcome to provide a pull request for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants