Skip to content

Commit

Permalink
fix(args): make header argument optional (#2678)
Browse files Browse the repository at this point in the history
* fix(args): make header argument optional

fixes #2677

* refactor(args): avoid using type aliases
  • Loading branch information
orhun authored Nov 2, 2023
1 parent 6666724 commit d85878f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bindgen-cli/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn parse_custom_derive(
)]
struct BindgenCommand {
/// C or C++ header file.
header: String,
header: Option<String>,
/// Path to write depfile to.
#[arg(long)]
depfile: Option<String>,
Expand Down Expand Up @@ -589,7 +589,11 @@ where

let mut builder = builder();

builder = builder.header(header);
if let Some(header) = header {
builder = builder.header(header);
} else {
return Err(io::Error::new(io::ErrorKind::Other, "Header not found"));
}

if let Some(rust_target) = rust_target {
builder = builder.rust_target(rust_target);
Expand Down

0 comments on commit d85878f

Please sign in to comment.