Commit graph

13 commits

Author SHA1 Message Date
Benjamin Levesque
45ecc5ece9
introduce AddJSONFlagsWithoutShorthand 2025-08-31 17:56:52 +02:00
Benjamin Levesque
faa0e2c26b
flag duplicate check 2025-08-20 20:02:00 +02:00
Babak K. Shandiz
a3ff7791db
Add tests to verify proper help:json-fields annotations
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-06 17:55:19 +01:00
w1mvy
9dd5805f9c
Add json export flags to variable list command (#8516) 2024-01-17 10:09:09 -08:00
Heath Stewart
0cf5d22ead
Support template, jq flags with standard format flag (#7832)
* Use standard JSON flags for project command

Deprecates the --format flag and adds the standard JSON flags to properly filter, template, and write JSON.

* Add format flags cmdutil

Resolves PR feedback

* Remove unnecessary fields from JSON format flags

* Add standard format help to remaining commands

* Add JSON format regression tests

Also fixed a number of `project` commands that didn't format the right object as JSON.

* Resolve PR feedback
2024-01-09 09:46:39 -08:00
Martijn Pieters
530002ee7a
Pretty-print JSON results of jq filtering (#7236)
When connected to a TTY, tell the jq formatter to indent the output, and
enable colorization of the output if the terminal supports it.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-04-25 13:27:17 +00:00
Mislav Marohnić
436d9ef859
Fix "missing method Fd" crash on Windows (#6200)
This ensures that `IOStreams.Out` always keeps the original `Fd()` value even if it's wrapped as a Colorable stream for Windows in cases when enabling virtual terminal processing has failed.
2022-09-06 17:29:06 +02:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Mislav Marohnić
83a08aa3ba Remove unnecessary pointers to Go maps 2021-10-25 17:20:12 +02:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Heath Stewart
e2973453b5
Add helper template functions for rendering tables (#3519)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-08-23 21:00:25 +02:00
Mislav Marohnić
5f0301c990 Have Exporter.Write automatically call ExportData on given data structure 2021-05-12 17:05:15 +02:00
Mislav Marohnić
654bd29ca0 Disallow unsupported values for --json flag 2021-04-14 19:58:58 +02:00