Document and validate automatic usage reporting
This commit is contained in:
@@ -43,9 +43,12 @@ func (a *App) Execute(ctx context.Context, args []string, streams Streams) Outco
|
||||
var outcome Outcome
|
||||
path := parsed.Path
|
||||
handlerRan := false
|
||||
payload := routedSnapshot.runners[parsed.Key]
|
||||
featureRequired := !parsed.HelpRequested && current.route.kind == routeCanonical &&
|
||||
payload != nil && payload.hasRun() && !routedSnapshot.builtins[parsed.Key]
|
||||
if parsed.Failure != nil {
|
||||
outcome = Usage(parsed.Failure.Message)
|
||||
} else if err := current.prepareFeatures(parsed, !parsed.HelpRequested && current.route.kind == routeCanonical); err != nil {
|
||||
} else if err := current.prepareFeatures(parsed, featureRequired); err != nil {
|
||||
outcome = classifyInputError(err)
|
||||
} else if current.route.kind == routeDiscovery {
|
||||
if parsed.HelpRequested {
|
||||
|
||||
Reference in New Issue
Block a user