package cli import ( "fmt" "strings" "time" "github.com/google/uuid" "golang.org/x/xerrors" "github.com/coder/coder/v2/cli/cliui" "github.com/coder/coder/v2/codersdk" "github.com/coder/pretty" "github.com/coder/serpent" ) func (r *RootCmd) templateVersions() *serpent.Command { cmd := &serpent.Command{ Use: "versions", Short: "Manage different versions of the specified template", Aliases: []string{"version"}, Long: formatExamples( example{ Description: "List versions of a specific template", Command: "coder templates versions list my-template", }, ), Handler: func(inv *serpent.Invocation) error { return inv.Command.HelpHandler(inv) }, Children: []*serpent.Command{ r.templateVersionsList(), r.archiveTemplateVersion(), r.unarchiveTemplateVersion(), }, } return cmd } func (r *RootCmd) templateVersionsList() *serpent.Command { defaultColumns := []string{ "Name", "Created At", "Created By", "Status", "Active", } formatter := cliui.NewOutputFormatter( cliui.TableFormat([]templateVersionRow{}, defaultColumns), cliui.JSONFormat(), ) client := new(codersdk.Client) var includeArchived serpent.Bool cmd := &serpent.Command{ Use: "list