qbec icon indicating copy to clipboard operation
qbec copied to clipboard

add --multi flag to jsonnet-qbec binary

Open gree-gorey opened this issue 6 years ago • 1 comments

This is a feature proposal.

I used jsonnet to render kube-prometheus manifests. However, native jsonnet lacks the parseYaml function that I really need. So I started using jsonnet-qbec tool which is a great tool, but now I miss the --multi argument that native jsonnet binary has: it allows you to "Write multiple files to the directory, list files on stdout". It is very helpful for using with pipes when you have really large json output, smth like:

jsonnet -J vendor --multi manifests "${1-example.jsonnet}" | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {}

gree-gorey avatar Aug 09 '19 13:08 gree-gorey

To be honest jsonnet-qbec is half assed in terms of providing just the basic form of the eval command and parsing the command line differently from how go-Jsonnet does it. I think this could be fixed by mostly copying the main program from the go-jsonnet repo. Happy to accept a PR if you want to do that.

Sent from my iPhone

On Aug 9, 2019, at 6:12 AM, Grigorii Ignatev [email protected] wrote:

This is a feature proposal.

I used jsonnet to render kube-prometheus manifests. However, native jsonnet lacks the parseYaml function that I really need. So I started using jsonnet-qbec tool which is a great tool, but now I miss the --multi argument that native jsonnet binary has: it allows you to "Write multiple files to the directory, list files on stdout". It is very helpful for using with pipes when you have really large json output, smth like:

jsonnet -J vendor --multi manifests "${1-example.jsonnet}" | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {} — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

gotwarlost avatar Aug 09 '19 17:08 gotwarlost