Skip to content

Commit

Permalink
Let clap handle missing headers
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdrz committed Nov 21, 2024
1 parent 3bd911e commit d75fe27
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions bindgen/options/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fn parse_custom_attribute(
)]
struct BindgenCommand {
/// C or C++ header file.
header: Option<String>,
header: String,
/// Path to write depfile to.
#[arg(long)]
depfile: Option<String>,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -824,8 +818,11 @@ where
}
}

let header = Some(header);

builder = apply_args!(
builder {
header,
rust_target,
default_enum_style,
bitfield_enum,
Expand Down

0 comments on commit d75fe27

Please sign in to comment.