package cmd

import (
	"fmt"
	"io"
)

func writeDiagnoseSearchOutput(stdout io.Writer, bundle DiagnoseBundle, outputFormat string) error {
	switch outputFormat {
	case "json":
		return writeJSON(stdout, bundle)
	case "table":
		return writeDiagnoseBundleTableOutput(stdout, bundle)
	default:
		return fmt.Errorf("output must be one of: table, json")
	}
}
