forked from toolshed/abra
		
	fix: initial subcmd completion
Broken by migration to v1 API.
This commit is contained in:
		| @ -14,6 +14,7 @@ import ( | ||||
| 	"coopcloud.tech/abra/cli/recipe" | ||||
| 	"coopcloud.tech/abra/cli/record" | ||||
| 	"coopcloud.tech/abra/cli/server" | ||||
| 	"coopcloud.tech/abra/pkg/autocomplete" | ||||
| 	"coopcloud.tech/abra/pkg/config" | ||||
| 	"coopcloud.tech/abra/pkg/web" | ||||
| 	"github.com/sirupsen/logrus" | ||||
| @ -162,6 +163,7 @@ func newAbraApp(version, commit string) *cli.App { | ||||
| 			UpgradeCommand, | ||||
| 			AutoCompleteCommand, | ||||
| 		}, | ||||
| 		BashComplete: autocomplete.SubcommandComplete, | ||||
| 		Authors: []cli.Author{ | ||||
| 			// If you're looking at this and you hack on Abra and you're not listed | ||||
| 			// here, please do add yourself! This is a community project, let's show | ||||
|  | ||||
| @ -40,3 +40,24 @@ func RecipeNameComplete(c *cli.Context) { | ||||
| 		fmt.Println(name) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // SubcommandComplete completes subcommands. | ||||
| func SubcommandComplete(c *cli.Context) { | ||||
| 	if c.NArg() > 0 { | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	subcmds := []string{ | ||||
| 		"app", | ||||
| 		"autocomplete", | ||||
| 		"catalogue", | ||||
| 		"recipe", | ||||
| 		"record", | ||||
| 		"server", | ||||
| 		"upgrade", | ||||
| 	} | ||||
|  | ||||
| 	for _, cmd := range subcmds { | ||||
| 		fmt.Println(cmd) | ||||
| 	} | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user