IsProgrammaticOutputFormat tells you if it is acceptable for your command to print miscellaneous output to stdout, such as progress messages. If your command is capable of printing such things, you should check the output format first, lest you print a progress message into the middle of a JSON docu
(outputFormat string)
| 82 | // If your command is capable of printing such things, you should check the output format |
| 83 | // first, lest you print a progress message into the middle of a JSON document by accident. |
| 84 | func IsProgrammaticOutputFormat(outputFormat string) bool { // TODO consider whether we should move this into the Factory |
| 85 | switch outputFormat { |
| 86 | case OutputFormatJson, OutputFormatBasic: |
| 87 | return true |
| 88 | default: |
| 89 | return false |
| 90 | } |
| 91 | } |
no outgoing calls
no test coverage detected