refactor: autocomplete package
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-12-12 00:17:39 +01:00
parent 32dcddb631
commit ae6adace50
20 changed files with 83 additions and 259 deletions

View File

@ -3,6 +3,7 @@ package app
import (
"fmt"
"coopcloud.tech/abra/pkg/autocomplete"
"coopcloud.tech/abra/pkg/catalogue"
"coopcloud.tech/abra/pkg/config"
"coopcloud.tech/abra/pkg/recipe"
@ -38,18 +39,7 @@ Chas mode ("--chaos") will deploy your local checkout of a recipe as-is,
including unstaged changes and can be useful for live hacking and testing new
recipes.
`,
BashComplete: func(c *cli.Context) {
appNames, err := config.GetAppNames()
if err != nil {
logrus.Warn(err)
}
if c.NArg() > 0 {
return
}
for _, a := range appNames {
fmt.Println(a)
}
},
BashComplete: autocomplete.AppNameComplete,
Action: func(c *cli.Context) error {
app := internal.ValidateApp(c)
stackName := app.StackName()