Merge pull request 'feat: auto-complete app and recipe names' (#89) from knoflook/abra:main into main

Reviewed-on: coop-cloud/abra#89
This commit is contained in:
2021-09-08 12:16:41 +00:00
16 changed files with 205 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import (
"coopcloud.tech/abra/cli/formatter"
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/pkg/catalogue"
"coopcloud.tech/abra/pkg/config"
"coopcloud.tech/tagcmp"
"github.com/docker/distribution/reference"
@ -90,4 +91,16 @@ var recipeLintCommand = &cli.Command{
return nil
},
BashComplete: func(c *cli.Context) {
catl, err := catalogue.ReadRecipeCatalogue()
if err != nil {
return
}
if c.NArg() > 0 {
return
}
for name, _ := range catl {
fmt.Println(name)
}
},
}