feat(list): adds plain json formatting
This commit is contained in:
parent
15c1d6733c
commit
ce7336324f
4 changed files with 34 additions and 7 deletions
4
testdata/help-list.ct
vendored
4
testdata/help-list.ct
vendored
|
|
@ -11,7 +11,7 @@ Aliases:
|
|||
Flags:
|
||||
-b, --base64 view binary data as base64
|
||||
-c, --count print only the count of matching entries
|
||||
-o, --format format output format (table|tsv|csv|markdown|html|ndjson) (default table)
|
||||
-o, --format format output format (table|tsv|csv|markdown|html|ndjson|json) (default table)
|
||||
-f, --full show full values without truncation
|
||||
-h, --help help for list
|
||||
-k, --key strings filter keys with glob pattern (repeatable)
|
||||
|
|
@ -31,7 +31,7 @@ Aliases:
|
|||
Flags:
|
||||
-b, --base64 view binary data as base64
|
||||
-c, --count print only the count of matching entries
|
||||
-o, --format format output format (table|tsv|csv|markdown|html|ndjson) (default table)
|
||||
-o, --format format output format (table|tsv|csv|markdown|html|ndjson|json) (default table)
|
||||
-f, --full show full values without truncation
|
||||
-h, --help help for list
|
||||
-k, --key strings filter keys with glob pattern (repeatable)
|
||||
|
|
|
|||
5
testdata/list-format-json.ct
vendored
Normal file
5
testdata/list-format-json.ct
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# JSON array format output via list
|
||||
$ pda set a@jf 1
|
||||
$ pda set b@jf 2
|
||||
$ pda ls jf --format json
|
||||
[{"key":"a","value":"1","encoding":"text"},{"key":"b","value":"2","encoding":"text"}]
|
||||
Loading…
Add table
Add a link
Reference in a new issue