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

Function parseOutputFormat

cmd/output.go:269–282  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

267}
268
269func parseOutputFormat(value string) (output.Format, error) {
270 switch output.Format(value) {
271 case output.FormatText:
272 return output.FormatText, nil
273 case output.FormatJSON:
274 return output.FormatJSON, nil
275 default:
276 return "", invalidArgumentsErrorfWithDetails(
277 "unsupported output format %q: use text or json",
278 flagValueErrorDetails(outputFlag, value),
279 value,
280 )
281 }
282}
283
284func validateOutputFormat(cmd *cobra.Command) error {
285 format, err := commandOutputFormatE(cmd)

Calls 3

FormatTypeAlias · 0.92
flagValueErrorDetailsFunction · 0.85