Crates.io | json-generator |
lib.rs | json-generator |
version | 0.1.6 |
source | src |
created_at | 2019-07-30 17:30:30.109285 |
updated_at | 2019-07-31 03:42:10.397077 |
description | CLI tool to generate JSON from simple DSL |
homepage | |
repository | https://github.com/tdbgamer/json-generator-rs |
max_upload_size | |
id | 153007 |
size | 22,011 |
After you have installed rustup.
$ cargo install json-generator
$ jg -h
jg 0.1.3
Timothy Bess <tdbgamer@gmail.com>
Takes in JSON DSL and outputs correctly formatted JSON
USAGE:
jg [FLAGS] <dsl_text>
FLAGS:
-h, --help Prints help information
-p, --pretty
-V, --version Prints version information
ARGS:
<dsl_text>
$ jg -p 'query=bool=must=[match=foo=bar, match=bar=200]'
{
"query": {
"bool": {
"must": [
{
"match": {
"foo": "bar"
}
},
{
"match": {
"bar": 200
}
}
]
}
}
}
$ jg -p 'a=b c=d d=e e=f'
{
"a": "b",
"c": "d",
"d": "e",
"e": "f"
}
$ jg -p '[a, b, c, d, e, f]'
[
"a",
"b",
"c",
"d",
"e",
"f"
]
$ jg -p '[1, 1.1, 1.2e10, -100]'
[
1,
1.1,
12000000000.0,
-100
]