(jsonFlag, quiet, idsOnly, count, markdown, styled, agent bool)
| 303 | } |
| 304 | |
| 305 | func FormatFromFlags(jsonFlag, quiet, idsOnly, count, markdown, styled, agent bool) Format { |
| 306 | switch { |
| 307 | case count: |
| 308 | return FormatCount |
| 309 | case idsOnly: |
| 310 | return FormatIDs |
| 311 | case quiet: |
| 312 | return FormatQuiet |
| 313 | case jsonFlag || agent: |
| 314 | return FormatJSON |
| 315 | case markdown: |
| 316 | return FormatMarkdown |
| 317 | case styled: |
| 318 | return FormatStyled |
| 319 | default: |
| 320 | return FormatAuto |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | func NormalizeJSONNumbers(data []byte) (any, error) { |
| 325 | dec := json.NewDecoder(bytes.NewReader(data)) |
no outgoing calls