MCPcopy Create free account
hub / github.com/dropbox/dbxcli / validateOutputFormat

Function validateOutputFormat

cmd/output.go:284–293  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

282}
283
284func validateOutputFormat(cmd *cobra.Command) error {
285 format, err := commandOutputFormatE(cmd)
286 if err != nil {
287 return err
288 }
289 if format == output.FormatJSON && !commandSupportsStructuredOutput(cmd) {
290 return output.ErrStructuredOutputUnsupported
291 }
292 return nil
293}
294
295func commandSupportsStructuredOutput(cmd *cobra.Command) bool {
296 return cmd != nil && cmd.Annotations[structuredOutputSupportedAnnotation] == "true"

Calls 2

commandOutputFormatEFunction · 0.85