diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs index c5d2b063..a73b0fee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -46,19 +46,16 @@ pub fn main() { match builder_from_flags(bind_args.into_iter()) { Ok((builder, output)) => { + let verbose = (&builder).is_verbose(); let builder_result = panic::catch_unwind(|| builder.generate().expect("Unable to generate bindings") ); if builder_result.is_err() { - println!("Bindgen unexpectedly panicked"); - println!("This may be caused by one of the known-unsupported \ - things (https://github.com/servo/rust-bindgen#c), \ - please modify the bindgen flags to work around it as \ - described in https://github.com/servo/rust-bindgen#c"); - println!("Otherwise, please file an issue at \ - https://github.com/servo/rust-bindgen/issues/new"); + if verbose { + print_verbose_err(); + } std::process::exit(1); } @@ -74,3 +71,13 @@ pub fn main() { } }; } + +fn print_verbose_err() { + println!("Bindgen unexpectedly panicked"); + println!("This may be caused by one of the known-unsupported \ + things (https://github.com/servo/rust-bindgen#c), \ + please modify the bindgen flags to work around it as \ + described in https://github.com/servo/rust-bindgen#c"); + println!("Otherwise, please file an issue at \ + https://github.com/servo/rust-bindgen/issues/new"); +} |