Resolve entered command routes to canonical paths

This commit is contained in:
2026-10-19 17:37:59 +00:00
parent 6ea8c4dd3f
commit 58b71c390f
8 changed files with 399 additions and 5 deletions

View File

@@ -23,7 +23,8 @@ func (a *App) Execute(ctx context.Context, args []string, streams Streams) Outco
streams = normalizeStreams(streams)
current := newExecution(a, ctx, streams)
routedSnapshot := current.snapshot
parsed := current.parse(args)
current.route = resolveEnteredRoute(args, routedSnapshot)
parsed := current.parse(current.route.args)
if parsed.Failure != nil {
return current.present(Usage(errors.New(parsed.Failure.Message)), parsed.Path)
}
@@ -51,6 +52,7 @@ type execution struct {
options commandmeta.ParseOptions
snapshot *routingSnapshot
session *internalcobra.Session
route routeResult
}
type commandExecution struct {