top | item 32822326 Show HN: Tombl – Easily query .toml files from bash 45 points| snyball | 3 years ago |github.com | reply 10 comments order hn newest [+] [-] ducktective|3 years ago|reply Nice project! So it provides first-class support for bash (like arrays etc).There is also another way; we can convert toml to json via `rq` and query/filter with `jq`: curl -s 'https://raw.githubusercontent.com/snyball/tombl/master/Cargo.toml' \ | rq -t \ | jq '.package.name + " version is : " + .package.version' [+] [-] esamatti|3 years ago|reply Also checkout yj[1] which can convert between various formats among toml->json[1]: https://github.com/sclevine/yj [+] [-] snyball|3 years ago|reply Cool, didn't know about `rq`. Converting everything to json and using `jq` has been my goto for structural data-hacks on the command line, but yeah for my own usage of `tombl` the killer feature was getting a bash array out of the config. [+] [-] rascul|3 years ago|reply What is rq? I can't seem to find it in any package repo and searching for it leads to pages and pages of nothing relevant. load replies (1) [+] [-] PufPufPuf|3 years ago|reply There's already tomlq from https://github.com/kislyuk/yq, which can query TOML using jq syntax. [+] [-] unknown|3 years ago|reply [deleted] [+] [-] kosolam|3 years ago|reply Actually I wanted exactly something like that with the bash export function. Well done [+] [-] ovebepari|3 years ago|reply tomlq would've been a nicer name! [+] [-] kroltan|3 years ago|reply Or Bombadil (Bombadill? Bomb-a-dill?)
[+] [-] ducktective|3 years ago|reply Nice project! So it provides first-class support for bash (like arrays etc).There is also another way; we can convert toml to json via `rq` and query/filter with `jq`: curl -s 'https://raw.githubusercontent.com/snyball/tombl/master/Cargo.toml' \ | rq -t \ | jq '.package.name + " version is : " + .package.version' [+] [-] esamatti|3 years ago|reply Also checkout yj[1] which can convert between various formats among toml->json[1]: https://github.com/sclevine/yj [+] [-] snyball|3 years ago|reply Cool, didn't know about `rq`. Converting everything to json and using `jq` has been my goto for structural data-hacks on the command line, but yeah for my own usage of `tombl` the killer feature was getting a bash array out of the config. [+] [-] rascul|3 years ago|reply What is rq? I can't seem to find it in any package repo and searching for it leads to pages and pages of nothing relevant. load replies (1)
[+] [-] esamatti|3 years ago|reply Also checkout yj[1] which can convert between various formats among toml->json[1]: https://github.com/sclevine/yj
[+] [-] snyball|3 years ago|reply Cool, didn't know about `rq`. Converting everything to json and using `jq` has been my goto for structural data-hacks on the command line, but yeah for my own usage of `tombl` the killer feature was getting a bash array out of the config.
[+] [-] rascul|3 years ago|reply What is rq? I can't seem to find it in any package repo and searching for it leads to pages and pages of nothing relevant. load replies (1)
[+] [-] PufPufPuf|3 years ago|reply There's already tomlq from https://github.com/kislyuk/yq, which can query TOML using jq syntax.
[+] [-] kosolam|3 years ago|reply Actually I wanted exactly something like that with the bash export function. Well done
[+] [-] ovebepari|3 years ago|reply tomlq would've been a nicer name! [+] [-] kroltan|3 years ago|reply Or Bombadil (Bombadill? Bomb-a-dill?)
[+] [-] ducktective|3 years ago|reply
There is also another way; we can convert toml to json via `rq` and query/filter with `jq`:
[+] [-] esamatti|3 years ago|reply
[1]: https://github.com/sclevine/yj
[+] [-] snyball|3 years ago|reply
[+] [-] rascul|3 years ago|reply
[+] [-] PufPufPuf|3 years ago|reply
[+] [-] unknown|3 years ago|reply
[deleted]
[+] [-] kosolam|3 years ago|reply
[+] [-] ovebepari|3 years ago|reply
[+] [-] kroltan|3 years ago|reply