forked from toolshed/abra
fix: more robust <app> autocomplete + error handling
See toolshed/organising#652
This commit is contained in:
@ -2,6 +2,7 @@ package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"slices"
|
||||
@ -37,8 +38,8 @@ var AppLogsCommand = &cobra.Command{
|
||||
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.ServiceNameComplete(app.Name)
|
||||
default:
|
||||
|
Reference in New Issue
Block a user