getOutputFormat reads the --output flag value from the command.
(cmd *cobra.Command)
| 244 | |
| 245 | // getOutputFormat reads the --output flag value from the command. |
| 246 | func getOutputFormat(cmd *cobra.Command) string { |
| 247 | f, _ := cmd.Flags().GetString("output") |
| 248 | if f == "" { |
| 249 | return outputJSON |
| 250 | } |
| 251 | |
| 252 | return f |
| 253 | } |
| 254 | |
| 255 | // printJSON marshals v as indented JSON and writes it to stdout. |
| 256 | func printJSON(v any) error { |
no outgoing calls
no test coverage detected