summaryrefslogtreecommitdiff
path: root/internal/cli/jobs/render.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2022-08-04 23:17:08 +0200
committerValery Piashchynski <[email protected]>2022-08-04 23:17:08 +0200
commitbfeb471b3c725102aba0da1f11316bd770fac83f (patch)
tree715488b63df786ad6eea1e1342e0ac46f887d204 /internal/cli/jobs/render.go
parent024b54348c6d3ac34f48dc17c098d66554385d83 (diff)
feat: jobs cli commands
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'internal/cli/jobs/render.go')
-rw-r--r--internal/cli/jobs/render.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/cli/jobs/render.go b/internal/cli/jobs/render.go
new file mode 100644
index 00000000..c9f71e2d
--- /dev/null
+++ b/internal/cli/jobs/render.go
@@ -0,0 +1,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
+}