From 4d809171a7acb034ce7e3c6cd585936eaf72b927 Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Thu, 21 Nov 2024 15:16:17 -0500 Subject: [PATCH] Let clap handle missing headers --- bindgen/options/cli.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/bindgen/options/cli.rs b/bindgen/options/cli.rs index 86edd50455..0dc7fc0aa7 100644 --- a/bindgen/options/cli.rs +++ b/bindgen/options/cli.rs @@ -141,7 +141,7 @@ fn parse_custom_attribute( )] struct BindgenCommand { /// C or C++ header file. - header: Option, + header: String, /// Path to write depfile to. #[arg(long)] depfile: Option, @@ -673,12 +673,6 @@ where let mut builder = builder(); - if let Some(header) = header { - builder = builder.header(header); - } else { - return Err(io::Error::new(io::ErrorKind::Other, "Header not found")); - } - #[derive(Debug)] struct PrefixLinkNameCallback { prefix: String, @@ -824,8 +818,11 @@ where } } + let header = Some(header); + builder = apply_args!( builder { + header, rust_target, default_enum_style, bitfield_enum,