Fix reading contents from stdin in parse script.
All checks were successful
rustfmt Build rustfmt has succeeded
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded

This commit is contained in:
Tom Alexander 2023-09-04 11:45:10 -04:00
parent 33091112a5
commit 71180d19fb
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -43,12 +43,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn main_body() -> Result<(), Box<dyn std::error::Error>> {
let args = std::env::args();
let args = std::env::args().skip(1);
if args.is_empty() {
let org_contents = read_stdin_to_string()?;
run_anonymous_parse(org_contents)
} else {
for arg in args.skip(1) {
for arg in args {
run_parse_on_file(arg)?
}
Ok(())