feat: auto-complete app and recipe names #89

Merged
decentral1se merged 3 commits from knoflook/abra:main into main 2021-09-08 12:16:42 +00:00
Owner

@decentral1se in #83

Added bonus request: seems like we can BashComplete: func(c *cli.Context) { ... }? for abra app $tab/abra recipe $tab?

here it is. I only set it for a couple commands and still would like to discuss #87 but yeah, app/recipe name autocompletion is there!

@decentral1se in #83 >Added bonus request: seems like we can BashComplete: func(c *cli.Context) { ... }? for abra app $tab/abra recipe $tab? here it is. I only set it for a couple commands and still would like to discuss #87 but yeah, app/recipe name autocompletion is there!
knoflook added 1 commit 2021-09-07 15:01:38 +00:00
feat: auto-complete app and recipe names
All checks were successful
continuous-integration/drone/pr Build is passing
4c216fdf40
decentral1se reviewed 2021-09-07 17:11:35 +00:00
decentral1se left a comment
Owner

Wowza 🥇

Wowza 🥇
@ -36,2 +38,4 @@
return nil
},
BashComplete: func(c *cli.Context) {
appNames, err := config.GetDeployedApps()
Owner

Given coop-cloud/abra#87 (comment) I guess we can just do config.GetAppsNames and call it a day?

Given https://git.coopcloud.tech/coop-cloud/abra/issues/87#issuecomment-8528 I guess we can just do `config.GetAppsNames` and call it a day?
knoflook marked this conversation as resolved
@ -177,6 +177,46 @@ func GetApps(appFiles AppFiles) ([]App, error) {
return apps, nil
}
func GetAppsNames() ([]string, error) {
Owner

Maybe a nitpick but GetAppNames is easier to say 😀 (ignore ofc if you don't mind it)

Maybe a nitpick but `GetAppNames` is easier to say 😀 (ignore ofc if you don't mind it)
knoflook marked this conversation as resolved
@ -180,0 +180,4 @@
func GetAppsNames() ([]string, error) {
appFiles, err := LoadAppFiles("")
if err != nil {
return nil, err
Owner

return []string{}, err to pass an empty list and avoid nil errors somewhere else?

`return []string{}, err` to pass an empty list and avoid nil errors somewhere else?
knoflook marked this conversation as resolved
@ -180,0 +195,4 @@
return appNames, nil
}
func GetDeployedApps() ([]string, error) {
Owner

Yeah I guess we don't need this now but maybe keep it?

idk, could also just end up lurking there without being used 🤔

Yeah I guess we don't need this now but maybe keep it? idk, could also just end up lurking there without being used 🤔
Author
Owner

It's simple enought to rewrite so might as well get rid of it

It's simple enought to rewrite so might as well get rid of it
knoflook marked this conversation as resolved
knoflook added 1 commit 2021-09-08 11:45:48 +00:00
refactor: drop unused function, rename GetAppsNames
All checks were successful
continuous-integration/drone/pr Build is passing
cf2653fef8
knoflook added 1 commit 2021-09-08 12:01:45 +00:00
feat: autocomplete recipe names for more abra commands
All checks were successful
continuous-integration/drone/pr Build is passing
511619722f
decentral1se merged commit e114b2a939 into main 2021-09-08 12:16:42 +00:00
Sign in to join this conversation.
No description provided.