fix: more robust <app> autocomplete + error handling
All checks were successful
continuous-integration/drone/push Build is passing

See toolshed/organising#652
This commit is contained in:
2024-12-28 22:22:13 +01:00
parent 8ac31330be
commit fab93a559a
6 changed files with 38 additions and 32 deletions

View File

@ -46,8 +46,8 @@ beforehand.`,
case 1:
app, err := appPkg.Get(args[0])
if err != nil {
log.Debugf("autocomplete failed: %s", err)
return nil, cobra.ShellCompDirectiveDefault
errMsg := fmt.Sprintf("autocomplete failed: %s", err)
return []string{errMsg}, cobra.ShellCompDirectiveError
}
return autocomplete.RecipeVersionComplete(app.Recipe.Name)
default: