doctor: collapse healthy output to one line, add --verbose

A healthy host triggered ~20 PASS rows with details — too noisy for
the common case. Default now prints only fail/warn rows plus a
summary footer; an all-pass run collapses to a single line. Pass
--verbose / -v for the full per-check output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Thales Maciel 2026-05-01 14:18:09 -03:00
parent 09a3ef812f
commit 9b5cbed32d
No known key found for this signature in database
GPG key ID: 33112E6833C34679
4 changed files with 142 additions and 7 deletions

View file

@ -71,7 +71,8 @@ to diagnose host readiness problems.
}
func (d *deps) newDoctorCommand() *cobra.Command {
return &cobra.Command{
var verbose bool
cmd := &cobra.Command{
Use: "doctor",
Short: "Check host and runtime readiness",
Long: strings.TrimSpace(`
@ -85,8 +86,10 @@ Run 'banger doctor':
- after upgrading the host kernel or banger itself
- when 'banger vm run' fails with an unclear error
Exit code is non-zero if any check fails. Warnings are reported but
do not fail the run.
By default, prints failing and warning checks only and a summary
footer; a healthy host collapses to a single line. Pass --verbose to
print every check with its details. Exit code is non-zero if any
check fails. Warnings are reported but do not fail the run.
`),
Args: noArgsUsage("usage: banger doctor"),
RunE: func(cmd *cobra.Command, args []string) error {
@ -94,7 +97,7 @@ do not fail the run.
if err != nil {
return err
}
if err := printDoctorReport(cmd.OutOrStdout(), report); err != nil {
if err := printDoctorReport(cmd.OutOrStdout(), report, verbose); err != nil {
return err
}
if report.HasFailures() {
@ -103,6 +106,8 @@ do not fail the run.
return nil
},
}
cmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "show every check (default: only failures and warnings)")
return cmd
}
func newVersionCommand() *cobra.Command {