summaryrefslogtreecommitdiff
path: root/internal/cli/jobs/render.go
blob: c9f71e2d0a080a753be4bfbba032692256e7c165 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package jobs

import (
	"io"

	"github.com/olekukonko/tablewriter"
)

// JobsCommandsRender uses console renderer to show jobs
func renderPipelines(writer io.Writer, pipelines []string) *tablewriter.Table {
	tw := tablewriter.NewWriter(writer)
	tw.SetAutoWrapText(false)
	tw.SetHeader([]string{"Pipeline(s)"})
	tw.SetColWidth(50)
	tw.SetAlignment(tablewriter.ALIGN_LEFT)

	for i := 0; i < len(pipelines); i++ {
		tw.Append([]string{pipelines[i]})
	}

	return tw
}