HasStructuredOutput returns true when the command is configured to emit a machine-readable format, either through an explicit flag or a default output.
()
| 62 | // HasStructuredOutput returns true when the command is configured to emit a |
| 63 | // machine-readable format, either through an explicit flag or a default output. |
| 64 | func (f *PrintFlags) HasStructuredOutput() bool { |
| 65 | return f != nil && f.OutputFormat != nil && strings.TrimSpace(*f.OutputFormat) != "" |
| 66 | } |
| 67 | |
| 68 | func (f *PrintFlags) ToPrinter() (printers.Printer, error) { |
| 69 | outputFormat := "" |
no outgoing calls
no test coverage detected