diff --git a/modules/mesh-delivery-view/cmd/mesh-delivery-cli/main.go b/modules/mesh-delivery-view/cmd/mesh-delivery-cli/main.go index 74959b66a..51404efa5 100644 --- a/modules/mesh-delivery-view/cmd/mesh-delivery-cli/main.go +++ b/modules/mesh-delivery-view/cmd/mesh-delivery-cli/main.go @@ -37,11 +37,16 @@ func run(args []string, socket string, out, errOut io.Writer) int { asJSON := fs.Bool("json", false, "print the rows as JSON") follow := fs.Bool("follow", false, "pipelines and pipeline: print again at each change the runner's events say, until interrupted") next := fs.String("next", "", "pipeline: the cursor of the next page a pipeline's answer named") + limit := fs.Int("limit", view.DefaultPipelinesLimit, "pipelines: the newest this many pipelines of the branch") if err := fs.Parse(args); err != nil { return 2 } if fs.NArg() > 0 && (fs.Arg(0) == "pipelines" || fs.Arg(0) == "pipeline") { - return pipelines(socket, fs.Args(), *next, *follow, *asJSON, out, errOut) + if *limit < 1 { + fmt.Fprintln(errOut, "mesh-delivery-cli: -limit is a number of at least one") + return 2 + } + return pipelines(socket, fs.Args(), *next, *limit, *follow, *asJSON, out, errOut) } if fs.NArg() > 0 && fs.Arg(0) == "holds" { return holds(socket, *asJSON, out, errOut) @@ -62,7 +67,7 @@ func run(args []string, socket string, out, errOut io.Writer) int { } if fs.NArg() > 0 { if fs.Arg(0) != "answer" || fs.NArg() < 3 { - fmt.Fprintln(errOut, "mesh-delivery-cli shows the rows, or answers: mesh-delivery-cli answer