Render help through command aliases
This commit is contained in:
11
route.go
11
route.go
@@ -46,17 +46,20 @@ func resolveEnteredRoute(args []string, snapshot *routingSnapshot) routeResult {
|
||||
result.enteredPath = enteredEndpoint(path, origins, len(result.canonicalPath))
|
||||
} else if len(path) == 0 {
|
||||
result.kind = routeCanonical
|
||||
} else if discovery, ok := findDiscoveryPath(snapshot.discoveryFlags, path); ok {
|
||||
} else if discovery, ok := findDiscoveryPath(snapshot.discoveryFlags, path); ok && len(discovery) == len(path) {
|
||||
result.kind = routeDiscovery
|
||||
result.discoveryPath = discovery
|
||||
result.enteredPath = discovery.Clone()
|
||||
result.args = commandpath.CloneTokens(trailing)
|
||||
} else {
|
||||
result.enteredPath = path.Clone()
|
||||
}
|
||||
|
||||
result.args = make([]string, 0, len(resolved)+len(trailing))
|
||||
result.args = append(result.args, resolved...)
|
||||
result.args = append(result.args, trailing...)
|
||||
if result.kind != routeDiscovery {
|
||||
result.args = make([]string, 0, len(resolved)+len(trailing))
|
||||
result.args = append(result.args, resolved...)
|
||||
result.args = append(result.args, trailing...)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user