Skip to content

Commit

Permalink
Merge pull request #60 from hashicorp/template-table-list
Browse files Browse the repository at this point in the history
Waypoint: update the list display to use a table
  • Loading branch information
catsby authored Apr 30, 2024
2 parents d7d289c + 06b7505 commit db9fcbe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/60.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
waypoint: change template list format to use a table
```
8 changes: 7 additions & 1 deletion internal/commands/waypoint/templates/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,11 @@ func listTemplates(opts *TemplateOpts) error {
templates = append(templates, resp.GetPayload().ApplicationTemplates...)
}

return opts.Output.Show(templates, format.Pretty)
templateFields := []format.Field{
format.NewField("Name", "{{ .Name }}"),
format.NewField("ID", "{{ .ID }}"),
format.NewField("Summary", "{{ .Summary }}"),
}

return opts.Output.Display(format.NewDisplayer(templates, format.Table, templateFields))
}

0 comments on commit db9fcbe

Please sign in to comment.