feat: autocomplete recipe names for more abra commands

This commit is contained in:
2021-09-08 13:59:55 +02:00
parent cf2653fef8
commit 511619722f
8 changed files with 107 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import (
abraFormatter "coopcloud.tech/abra/cli/formatter"
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/pkg/client"
"coopcloud.tech/abra/pkg/config"
"coopcloud.tech/abra/pkg/secret"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
@ -234,6 +235,18 @@ var appSecretLsCommand = &cli.Command{
table.Render()
return nil
},
BashComplete: func(c *cli.Context) {
appNames, err := config.GetAppNames()
if err != nil {
return
}
if c.NArg() > 0 {
return
}
for _, a := range appNames {
fmt.Println(a)
}
},
}
var appSecretCommand = &cli.Command{