Discover help routes through intermediate aliases
This commit is contained in:
@@ -133,6 +133,20 @@ func (resolver *Resolver) Resolve(path commandpath.Path) commandpath.Path {
|
||||
}
|
||||
}
|
||||
|
||||
// ResolutionPaths returns the entered path and each path produced by a
|
||||
// longest-prefix rewrite. It supports metadata discovery along alias chains.
|
||||
// Installation validates termination before this method is used.
|
||||
func (resolver *Resolver) ResolutionPaths(path commandpath.Path) []commandpath.Path {
|
||||
paths := []commandpath.Path{path.Clone()}
|
||||
for {
|
||||
next, _, matched := resolver.ResolveOnce(paths[len(paths)-1])
|
||||
if !matched {
|
||||
return paths
|
||||
}
|
||||
paths = append(paths, next)
|
||||
}
|
||||
}
|
||||
|
||||
// ResolveWithProvenance resolves a command path and carries the input token
|
||||
// indexes that contributed to each output component. Rewritten target
|
||||
// components inherit the origins of the matched source prefix.
|
||||
|
||||
Reference in New Issue
Block a user