Require exact resolved paths for explicit help
This commit is contained in:
@@ -161,7 +161,9 @@ func (current *execution) renderHelpTargets(targets []string) Outcome {
|
||||
return Failure(errors.New("cannot render help without command metadata"))
|
||||
}
|
||||
route := resolveEnteredRoute(targets, snapshot)
|
||||
if route.kind == routeUnknown {
|
||||
// Explicit help targets are paths, not command invocations with operands.
|
||||
// Discovery routes have no canonical path and retain only trailing options.
|
||||
if route.kind == routeUnknown || len(route.args) != len(route.canonicalPath) {
|
||||
session := internalcobra.Prepare(snapshot.metadata, current.options)
|
||||
return current.app.renderHelpOutcomeWithSession(targets, current.streams, session)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user