mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(cli): add shell completions (#14341)
This commit is contained in:
@@ -40,11 +40,11 @@ func (r *RootCmd) templateVersions() *serpent.Command {
|
||||
|
||||
func (r *RootCmd) templateVersionsList() *serpent.Command {
|
||||
defaultColumns := []string{
|
||||
"Name",
|
||||
"Created At",
|
||||
"Created By",
|
||||
"Status",
|
||||
"Active",
|
||||
"name",
|
||||
"created at",
|
||||
"created by",
|
||||
"status",
|
||||
"active",
|
||||
}
|
||||
formatter := cliui.NewOutputFormatter(
|
||||
cliui.TableFormat([]templateVersionRow{}, defaultColumns),
|
||||
@@ -70,10 +70,10 @@ func (r *RootCmd) templateVersionsList() *serpent.Command {
|
||||
for _, opt := range i.Command.Options {
|
||||
if opt.Flag == "column" {
|
||||
if opt.ValueSource == serpent.ValueSourceDefault {
|
||||
v, ok := opt.Value.(*serpent.StringArray)
|
||||
v, ok := opt.Value.(*serpent.EnumArray)
|
||||
if ok {
|
||||
// Add the extra new default column.
|
||||
*v = append(*v, "Archived")
|
||||
_ = v.Append("Archived")
|
||||
}
|
||||
}
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user