validateReportFileFlags returns an error if --report-file is combined with an incompatible flag. --report-file only takes effect for --format markdown output and is bypassed when --json is set.
(reportFile, format string, jsonOutput bool)
| 469 | // incompatible flag. --report-file only takes effect for --format markdown output |
| 470 | // and is bypassed when --json is set. |
| 471 | func validateReportFileFlags(reportFile, format string, jsonOutput bool) error { |
| 472 | if reportFile == "" { |
| 473 | return nil |
| 474 | } |
| 475 | if format != "markdown" { |
| 476 | return errors.New("--report-file requires --format markdown") |
| 477 | } |
| 478 | if jsonOutput { |
| 479 | return errors.New("--report-file cannot be used with --json") |
| 480 | } |
| 481 | return nil |
| 482 | } |