Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print CLI errors to stderr instead of stdout #2840

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions bindgen-cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn main() {
if verbose {
print_verbose_err()
}
println!("{}", info);
eprintln!("{}", info);
}));

let bindings =
Expand All @@ -49,21 +49,21 @@ pub fn main() {
bindings.write(output).expect("Unable to write output");
}
Err(error) => {
println!("{}", error);
eprintln!("{}", error);
std::process::exit(1);
}
};
}

fn print_verbose_err() {
println!("Bindgen unexpectedly panicked");
println!(
eprintln!("Bindgen unexpectedly panicked");
eprintln!(
"This may be caused by one of the known-unsupported \
things (https://rust-lang.github.io/rust-bindgen/cpp.html), \
please modify the bindgen flags to work around it as \
described in https://rust-lang.github.io/rust-bindgen/cpp.html"
);
println!(
eprintln!(
"Otherwise, please file an issue at \
https://github.com/rust-lang/rust-bindgen/issues/new"
);
Expand Down
Loading