Resolve entered command routes to canonical paths
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user