forked from toolshed/abra
		
	| @ -1,11 +1,11 @@ | ||||
| package autocomplete | ||||
|  | ||||
| import ( | ||||
| 	"fmt" | ||||
| 	"sort" | ||||
|  | ||||
| 	"coopcloud.tech/abra/pkg/app" | ||||
| 	appPkg "coopcloud.tech/abra/pkg/app" | ||||
| 	"coopcloud.tech/abra/pkg/i18n" | ||||
| 	"coopcloud.tech/abra/pkg/recipe" | ||||
| 	"github.com/spf13/cobra" | ||||
| ) | ||||
| @ -14,7 +14,7 @@ import ( | ||||
| func AppNameComplete() ([]string, cobra.ShellCompDirective) { | ||||
| 	appFiles, err := app.LoadAppFiles("") | ||||
| 	if err != nil { | ||||
| 		err := fmt.Sprintf("autocomplete failed: %s", err) | ||||
| 		err := i18n.G("autocomplete failed: %s", err) | ||||
| 		return []string{err}, cobra.ShellCompDirectiveError | ||||
| 	} | ||||
|  | ||||
| @ -29,7 +29,7 @@ func AppNameComplete() ([]string, cobra.ShellCompDirective) { | ||||
| func ServiceNameComplete(appName string) ([]string, cobra.ShellCompDirective) { | ||||
| 	serviceNames, err := app.GetAppServiceNames(appName) | ||||
| 	if err != nil { | ||||
| 		err := fmt.Sprintf("autocomplete failed: %s", err) | ||||
| 		err := i18n.G("autocomplete failed: %s", err) | ||||
| 		return []string{err}, cobra.ShellCompDirectiveError | ||||
| 	} | ||||
|  | ||||
| @ -40,7 +40,7 @@ func ServiceNameComplete(appName string) ([]string, cobra.ShellCompDirective) { | ||||
| func RecipeNameComplete() ([]string, cobra.ShellCompDirective) { | ||||
| 	catl, err := recipe.ReadRecipeCatalogue(false) | ||||
| 	if err != nil { | ||||
| 		err := fmt.Sprintf("autocomplete failed: %s", err) | ||||
| 		err := i18n.G("autocomplete failed: %s", err) | ||||
| 		return []string{err}, cobra.ShellCompDirectiveError | ||||
| 	} | ||||
|  | ||||
| @ -56,7 +56,7 @@ func RecipeNameComplete() ([]string, cobra.ShellCompDirective) { | ||||
| func RecipeVersionComplete(recipeName string) ([]string, cobra.ShellCompDirective) { | ||||
| 	catl, err := recipe.ReadRecipeCatalogue(true) | ||||
| 	if err != nil { | ||||
| 		err := fmt.Sprintf("autocomplete failed: %s", err) | ||||
| 		err := i18n.G("autocomplete failed: %s", err) | ||||
| 		return []string{err}, cobra.ShellCompDirectiveError | ||||
| 	} | ||||
|  | ||||
| @ -74,7 +74,7 @@ func RecipeVersionComplete(recipeName string) ([]string, cobra.ShellCompDirectiv | ||||
| func ServerNameComplete() ([]string, cobra.ShellCompDirective) { | ||||
| 	files, err := app.LoadAppFiles("") | ||||
| 	if err != nil { | ||||
| 		err := fmt.Sprintf("autocomplete failed: %s", err) | ||||
| 		err := i18n.G("autocomplete failed: %s", err) | ||||
| 		return []string{err}, cobra.ShellCompDirectiveError | ||||
| 	} | ||||
|  | ||||
| @ -90,13 +90,13 @@ func ServerNameComplete() ([]string, cobra.ShellCompDirective) { | ||||
| func CommandNameComplete(appName string) ([]string, cobra.ShellCompDirective) { | ||||
| 	app, err := app.Get(appName) | ||||
| 	if err != nil { | ||||
| 		err := fmt.Sprintf("autocomplete failed: %s", err) | ||||
| 		err := i18n.G("autocomplete failed: %s", err) | ||||
| 		return []string{err}, cobra.ShellCompDirectiveError | ||||
| 	} | ||||
|  | ||||
| 	cmdNames, err := appPkg.ReadAbraShCmdNames(app.Recipe.AbraShPath) | ||||
| 	if err != nil { | ||||
| 		err := fmt.Sprintf("autocomplete failed: %s", err) | ||||
| 		err := i18n.G("autocomplete failed: %s", err) | ||||
| 		return []string{err}, cobra.ShellCompDirectiveError | ||||
| 	} | ||||
|  | ||||
| @ -111,7 +111,7 @@ func SecretComplete(recipeName string) ([]string, cobra.ShellCompDirective) { | ||||
|  | ||||
| 	config, err := r.GetComposeConfig(nil) | ||||
| 	if err != nil { | ||||
| 		err := fmt.Sprintf("autocomplete failed: %s", err) | ||||
| 		err := i18n.G("autocomplete failed: %s", err) | ||||
| 		return []string{err}, cobra.ShellCompDirectiveError | ||||
| 	} | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user