6 ms·
Show HN: Tombl – Easily query .toml files from bash
- deleted 4y ago[deleted]
- ducktective 4y agoNice 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'
- snyball 4y agoCool, 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 4y agoWhat 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.
- gloria_mundi 4y agoProbably this: https://github.com/dflemstr/rq https://github.com/dflemstr/rq
- rascul 4y agoThanks. Turns out it was on HN earlier this year. https://news.ycombinator.com/item?id=31184825 https://news.ycombinator.com/item?id=31184825
- esamatti 4y agoAlso checkout yj[1] which can convert between various formats among toml->json [1]: https://github.com/sclevine/yj https://github.com/sclevine/yj
- ovebepari 4y agotomlq would've been a nicer name!
- kroltan 4y agoOr Bombadil (Bombadill? Bomb-a-dill?)
- PufPufPuf 4y agoThere's already tomlq from https://github.com/kislyuk/yq https://github.com/kislyuk/yq, which can query TOML using jq syntax.
- kosolam 4y agoActually I wanted exactly something like that with the bash export function. Well done