Retain discovery prefixes in usage diagnostics
This commit is contained in:
@@ -194,7 +194,13 @@ func (current *execution) usageLine(path []string) string {
|
||||
|
||||
func (current *execution) present(outcome Outcome, path []string) Outcome {
|
||||
usageLine := func(path []string) string { return current.usageLine(path) }
|
||||
if current.route.kind == routeCanonical && !current.route.enteredPath.Equal(current.route.canonicalPath) {
|
||||
switch {
|
||||
case current.route.kind == routeDiscovery:
|
||||
path = clonePath(current.route.enteredPath)
|
||||
usageLine = func([]string) string {
|
||||
return fmt.Sprintf("Usage: %s %s [command]", current.app.identity.Name, current.route.enteredPath.String())
|
||||
}
|
||||
case current.route.kind == routeCanonical && !current.route.enteredPath.Equal(current.route.canonicalPath):
|
||||
path = clonePath(current.route.enteredPath)
|
||||
usageLine = func([]string) string { return current.routeUsageLine() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user