Skip to content

Commit

Permalink
Exit quietly on broken pipes
Browse files Browse the repository at this point in the history
  • Loading branch information
whitfin committed Jan 5, 2024
1 parent 718b7c6 commit d8f427c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ use std::io::{self, BufReader, Read, Write};
const EOL: &[u8; 1] = &[b'\n'];

fn main() -> io::Result<()> {
let result = run();

if let Err(ref err) = result {
if err.kind() != io::ErrorKind::BrokenPipe {
return result;
}
}

Ok(())
}

fn run() -> io::Result<()> {
// parse in our options from the command line args
let options = Options::from(env::args_os());

Expand Down

0 comments on commit d8f427c

Please sign in to comment.