Crates.io | kq |
lib.rs | kq |
version | 1.0.6 |
source | src |
created_at | 2021-09-13 04:12:53.093028 |
updated_at | 2021-10-22 05:13:16.504987 |
description | A jq-like cli tool that can query and transform kdl right in the command line |
homepage | https://github.com/jihchi/kq |
repository | https://github.com/jihchi/kq.git |
max_upload_size | |
id | 450295 |
size | 176,277 |
A jq-like cli tool that can query and transform KDL document right in the command line.
||
and Map Operator are not supported yet.
You can find prebuilt binaries for Linux, macOS and Windows in the release page.
$ cargo install kq
$ docker run ghcr.io/jihchi/kq -v
$ kq -h
Usage: kq [options] <selector>
Options:
-h, --help print this help menu
-v, --version print the version
Modified from https://github.com/kdl-org/kdl/blob/1.0.0/QUERY-SPEC.md#examples
Given following content:
$ cat example.kdl
package {
name "foo"
version "1.0.0"
dependencies platform="windows" {
winapi "1.0.0" path="./crates/my-winapi-fork"
}
dependencies {
miette "2.0.0" dev=true
}
}
$ cat example.kdl | kq "package name"
name "foo"
$ cat example.kdl | kq "dependencies"
dependencies platform="windows" {
winapi "1.0.0" path="./crates/my-winapi-fork"
}
dependencies {
miette "2.0.0" dev=true
}
$ cat example.kdl | kq "dependencies[platform]"
dependencies platform="windows" {
winapi "1.0.0" path="./crates/my-winapi-fork"
}
$ cat example.kdl | kq "dependencies > []"
winapi "1.0.0" path="./crates/my-winapi-fork"
miette "2.0.0" dev=true