Skip to content

Commit 1826827

Browse files
committed
Use docopt for argument parsing
This commit switches bindgen over to using the docopt crate for argument parsing instead of manual argument parsing. This required two notable changes in the arguments and flags style: 1. All flags of the form `-foo` are now of the form `--foo`. 2. We can no longer pass unknown flags straight through to clang. Instead, the user appends `--` after the bindgen flags and input header, after which point any more flags and arguments get collected and passed to clang. This required changes to the test runner and the `// bindgen-flags` comments.
1 parent bc36f9e commit 1826827

20 files changed

+256
-251
lines changed

Cargo.toml

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,49 @@
11
[package]
2-
name = "bindgen"
3-
version = "0.16.0"
4-
description = "A binding generator for Rust"
52
authors = ["Jyun-Yan You <[email protected]>"]
6-
license = "BSD-3-Clause"
3+
build = "build.rs"
4+
description = "A binding generator for Rust"
75
homepage = "https://github.com/crabtw/rust-bindgen"
8-
repository = "https://github.com/crabtw/rust-bindgen"
6+
keywords = ["bindings", "ffi", "code-generation"]
7+
license = "BSD-3-Clause"
8+
name = "bindgen"
99
readme = "README.md"
10-
keywords = [ "bindings", "ffi", "code-generation" ]
11-
build = "build.rs"
10+
repository = "https://github.com/crabtw/rust-bindgen"
11+
version = "0.16.0"
1212

13-
[dependencies]
14-
aster = { version = "0.21.1", features = ["with-syntex"] }
15-
quasi = { version = "0.15", features = ["with-syntex"] }
16-
clippy = { version = "*", optional = true }
17-
syntex_syntax = "0.38"
18-
log = "0.3.*"
19-
libc = "0.2.*"
20-
clang-sys = "0.8.0"
13+
[[bin]]
14+
doc = false
15+
name = "bindgen"
2116

2217
[build-dependencies]
2318
quasi_codegen = "0.15"
2419

20+
[dependencies]
21+
clang-sys = "0.8.0"
22+
docopt = "0.6.82"
23+
libc = "0.2.*"
24+
log = "0.3.*"
25+
rustc-serialize = "0.3.19"
26+
syntex_syntax = "0.38"
27+
28+
[dependencies.aster]
29+
features = ["with-syntex"]
30+
version = "0.21.1"
31+
32+
[dependencies.clippy]
33+
optional = true
34+
version = "*"
35+
36+
[dependencies.quasi]
37+
features = ["with-syntex"]
38+
version = "0.15"
39+
2540
[features]
26-
static = []
2741
llvm_stable = []
42+
static = []
2843

2944
[lib]
3045
name = "bindgen"
3146
path = "src/lib.rs"
3247

33-
[[bin]]
34-
name = "bindgen"
35-
doc = false
36-
3748
[[test]]
3849
name = "tests"

0 commit comments

Comments
 (0)