Deliver shell completion query replies

This commit is contained in:
2026-11-03 04:06:05 +00:00
parent 4c47a0ca0b
commit d1f31d2931
7 changed files with 412 additions and 6 deletions

View File

@@ -30,6 +30,9 @@ func (a *App) Execute(ctx context.Context, args []string, streams Streams) Outco
err := errors.New("invocation context must not be nil")
return current.finalize(Failure(err.Error()).WithCause(err), nil, false)
}
if current.snapshot != nil && current.snapshot.completion && len(args) > 0 && args[0] == internalcobra.CompletionQueryToken {
return current.complete(args[1:])
}
routedSnapshot := current.snapshot
current.route = resolveEnteredRoute(args, routedSnapshot)
current.recordRouteEvents()