1
0
mirror of https://codeberg.org/crowci/crow.git synced 2025-08-09 07:42:52 +03:00

Use pagination helper to list pipelines in cli (#4478)

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Robert Kaussow
2024-12-01 20:39:47 +01:00
committed by GitHub
parent 7189cd61bf
commit 3c31284e7b
8 changed files with 62 additions and 86 deletions

View File

@@ -50,7 +50,7 @@ var Command = &cli.Command{
},
}
func pipelineOutput(c *cli.Command, resources []woodpecker.Pipeline, fd ...io.Writer) error {
func pipelineOutput(c *cli.Command, pipelines []*woodpecker.Pipeline, fd ...io.Writer) error {
outFmt, outOpt := output.ParseOutputOptions(c.String("output"))
noHeader := c.Bool("output-no-headers")
@@ -74,7 +74,7 @@ func pipelineOutput(c *cli.Command, resources []woodpecker.Pipeline, fd ...io.Wr
if err != nil {
return err
}
if err := tmpl.Execute(out, resources); err != nil {
if err := tmpl.Execute(out, pipelines); err != nil {
return err
}
case "table":
@@ -89,7 +89,7 @@ func pipelineOutput(c *cli.Command, resources []woodpecker.Pipeline, fd ...io.Wr
if !noHeader {
table.WriteHeader(cols)
}
for _, resource := range resources {
for _, resource := range pipelines {
if err := table.Write(cols, resource); err != nil {
return err
}