CertainLach / jrsonnet

Rust implementation of Jsonnet language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for stdin for --multi

iilyak opened this issue · comments

I would like to use jrsonnet as a tool which creates multiple files from stdin stream. However the multi flag doesn't support this feature.

{
  "first.rs": "pub fn foo() -> () {\n  println!(\"foo\");\n}",
  "second.rs": "pub fn bar() -> () {}"
}
❯ cat example.json | jrsonnet -m
error: a value is required for '--multi <MULTI>' but none was supplied

For more information, try '--help'.

❯ cat example.json | jrsonnet -m -
missing input argument

I provided an example.json here for demonstration purposes. However in my case it is an output of the shell pipe.

It turned out that I didn't used the -m feature correctly. The following works as expected

❯ cat example.json | jrsonnet -S -m ttt -
ttt/first.rs
ttt/second.rs

The only improvement that could be made is improving an error message.