Skip to content

Commit

Permalink
feat: add the baseline column in the flow ls CLI command (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoporoli authored Sep 17, 2024
1 parent 5a84987 commit 9360ef3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kardinal-cli/cmd/table_printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@ func printTemplateTable(templates []api_types.Template) {
// Update the existing printFlowTable function to use the new generic function
func printFlowTable(flows []api_types.Flow) {
data := lo.Map(flows, func(flow api_types.Flow, _ int) []string {
var baselineStr string
if flow.IsBaseline != nil && *flow.IsBaseline {
baselineStr = "✅"
}
return []string{
flow.FlowId,
strings.Join(lo.Map(flow.FlowUrls, func(item string, _ int) string { return fmt.Sprintf("http://%s", item) }), ", "),
baselineStr,
}
})

header := []string{"Flow ID", "Flow URL"}
header := []string{"Flow ID", "Flow URL", "Baseline"}
printGenericTable(header, data)
}

Expand Down

0 comments on commit 9360ef3

Please sign in to comment.