Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Make
--stdio
the default for non-tty stdin
In the case where an incompatible flag is not set, `--stdio` will now be implied when standard input is not a terminal. This enables uses like ```bash smlfmt < IN > OUT ``` without needing an additional flag. The flag is currently left in, but I don't think it is necessary since users can simply do `cat | smlfmt` or similar if they'd really like to type over stdin at the terminal. This isn't currently a breaking change since `--stdio` hasn't been included in a release yet, either any option (e.g., the one implemented here, or removing the explicit `--stdio` flag entirely) maintains backwards compatibility. Another option would be to let `-` have specific meaning as an input file, designating stdin, which is common in Unix utilities, although this would presumably be a breaking change (currently this results in the usage text, so it might not be a big deal, but I'm not sure if it is cumbersome to implement with the current args parser).
- Loading branch information