Normalize zero outcomes and omitted diagnostic delivery state

This commit is contained in:
2026-10-07 16:49:21 +00:00
parent f866ca98f9
commit b4010c43bd
4 changed files with 44 additions and 0 deletions

View File

@@ -88,6 +88,14 @@ func (a *App) commandAt(path []string) (Command, bool) {
}
func (a *App) present(outcome Outcome, path []string, streams Streams) Outcome {
if outcome.Kind == "" && outcome.Status == 0 && outcome.Domain == "" &&
outcome.Cause == nil && outcome.DeliveryError == nil &&
!outcome.ReportIncomplete && len(outcome.Diagnostics) == 0 {
outcome.Kind = OutcomeSuccess
}
if outcome.DiagnosticDelivery == "" {
outcome.DiagnosticDelivery = DeliveryNone
}
streams = normalizeStreams(streams)
if outcome.DiagnosticDelivery == DeliveryComplete {
return outcome