Since 1.1.17, running a script with -h / --help and no -p runs the default pipeline (the one with runIfOnlySpecified false) instead of printing the pipeline list. 1.1.16 prints the help.
Repro, same script under both versions:
#r "nuget: Fun.Build, 1.1.17" // works with 1.1.16
open Fun.Build
pipeline "Build" {
stage "build" { run "echo building" }
runIfOnlySpecified false
}
pipeline "Other" {
stage "x" { run "echo other" }
runIfOnlySpecified true
}
tryPrintPipelineCommandHelp ()
$ dotnet fsi build.fsx -- --help
- 1.1.16: prints
Pipelines: Build (default), Other and the usage block.
- 1.1.17: runs the
Build pipeline (echo building), then tryPrintPipelineCommandHelp prints the list afterwards.
Cause: #89 (Support run multiple pipelines in one execution) rewrote the dispatch in PipelineBuilder. Before, the isHelp check came first:
if isHelp then
match pipelineIndex with
| Some index when ... -> ctx.RunCommandHelp(verbose)
| _ -> ()
else
match pipelineIndex with
| ...
| None when not specified -> ctx.Run()
Now isHelp is only consulted inside the _ :: _ arm, so the no--p arm never sees it:
match pipelineIndexes with
| [] when not specified -> ctx.Run() // runs on --help too
| [] -> ()
| _ :: _ -> ... if isHelp then ctx.RunCommandHelp(verbose) else ctx.Run()
Expected: [] when not specified && not isHelp -> ctx.Run(), so --help without -p only prints.
Since 1.1.17, running a script with
-h/--helpand no-pruns the default pipeline (the one withrunIfOnlySpecified false) instead of printing the pipeline list. 1.1.16 prints the help.Repro, same script under both versions:
Pipelines: Build (default), Otherand the usage block.Buildpipeline (echo building), thentryPrintPipelineCommandHelpprints the list afterwards.Cause: #89 (
Support run multiple pipelines in one execution) rewrote the dispatch inPipelineBuilder. Before, theisHelpcheck came first:Now
isHelpis only consulted inside the_ :: _arm, so the no--parm never sees it:Expected:
[] when not specified && not isHelp -> ctx.Run(), so--helpwithout-ponly prints.