Crates.io | aki-json-pick |
lib.rs | aki-json-pick |
version | 0.1.10 |
source | src |
created_at | 2021-04-29 01:16:38.882517 |
updated_at | 2024-06-20 00:01:44.920348 |
description | The json pick out command. |
homepage | |
repository | https://github.com/aki-akaguma/aki-json-pick |
max_upload_size | |
id | 390838 |
size | 92,763 |
The json pick out command.
aki-json-pick --help
Usage:
aki-json-pick [options]
The json pick out command.
Options:
--color <when> json colored output.
-s, --select <selector> pick out json value by <selector>.
-p, --pretty pretty output.
-r, --raw-output raw string output without JSON double-quote.
-H, --help display this help and exit
-V, --version display version information and exit
-X <x-options> x options. try -X help
Option Parameters:
<when> 'always', 'never', or 'auto'
<selector> json selector
Examples:
pick out some.property value:
echo -e '{ "some": { "property": "yay!" } }' | aki-json-pick -s '"some"."property"'
command line:
cat fixtures/01.json | aki-json-pick -s '.'
result output:
"This is a valid JSON text with one value"
command line:
cat fixtures/01.json | aki-json-pick -s '"some"."property"'
result output:
"yay!"
command line:
cat fixtures/01.json | aki-json-pick -s '"primes".[0]'
result output:
7
command line:
cat fixtures/01.json | aki-json-pick -s '"primes"[0]"'
result output:
7
command line:
cat fixtures/01.json | aki-json-pick -s '"primes".[2,0]'
result output:
[13,7]
This crate use jql. The selector
is comatible.
See fn execute()
for this library examples.
This project is licensed under either of
at your option.