Right now we have --stdin and --stdout for roc format:
$ roc format --help
...
--stdin Read file to format from stdin
--stdout Print formatted file to stdout
I propose we merge these into a single flag called --stdin that reads from stdin and writes to stdout. I suspect this is what people would want most of the time. This is also what Zig does:
$ zig fmt --help
...
--stdin Format code from stdin; output to stdout
If you need more control you can always still pipe things:
cat input.roc | roc format --stdin
roc format --stdin > output.roc
This is a way that we can slightly decrease the surface area of the CLI which always seems nice to me :smile:
What does stdin without stdout even do?
And yeah, sounds good to merge
roc format foo.roc --stdout prints the formatted version of foo.roc to stdout. It looks like roc format --stdout is a noop (I haven't actually looked at the code). I'm not sure if there's anythign reasonable for it to do
Last updated: Jun 16 2026 at 16:19 UTC