feat: auto-complete app and recipe names
All checks were successful
continuous-integration/drone/pr Build is passing

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

@ -2,10 +2,12 @@ package app
import (
"context"
"fmt"
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/pkg/client"
stack "coopcloud.tech/abra/pkg/client/stack"
"coopcloud.tech/abra/pkg/config"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
)
@ -35,4 +37,16 @@ volumes as eligiblef or pruning once undeployed.
return nil
},
BashComplete: func(c *cli.Context) {
appNames, err := config.GetDeployedApps()
if err != nil {
return
}
if c.NArg() > 0 {
return
}
for _, a := range appNames {
fmt.Println(a)
}
},
}