feat(cli): add shell completions (#14341)

This commit is contained in:
Ethan
2024-08-20 14:47:46 +10:00
committed by GitHub
parent 6f9b3c1592
commit 0b2ba96065
80 changed files with 510 additions and 418 deletions
+7 -7
View File
@@ -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