feat: auto-complete app and recipe names

This commit is contained in:
2021-09-07 16:57:39 +02:00
parent 5f50c7960c
commit 4c216fdf40
8 changed files with 120 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import (
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/pkg/client"
"coopcloud.tech/abra/pkg/config"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
dockerClient "github.com/docker/docker/client"
@ -109,4 +110,16 @@ var appLogsCommand = &cli.Command{
return nil
},
BashComplete: func(c *cli.Context) {
appNames, err := config.GetAppsNames()
if err != nil {
return
}
if c.NArg() > 0 {
return
}
for _, a := range appNames {
fmt.Println(a)
}
},
}