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

@ -78,6 +78,18 @@ var appNewCommand = &cli.Command{
},
ArgsUsage: "<recipe>",
Action: action,
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)
}
},
}
// getRecipeMeta retrieves the recipe metadata from the recipe catalogue.