Skip to content

Commit

Permalink
Auto merge of #44 - fitzgen:use-docopt-for-args, r=emilio
Browse files Browse the repository at this point in the history
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.

r? @emilio
  • Loading branch information
bors-servo committed Aug 27, 2016
2 parents bc36f9e + 1826827 commit 0af8bd5
Show file tree
Hide file tree
Showing 20 changed files with 256 additions and 251 deletions.
51 changes: 31 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,49 @@
[package]
name = "bindgen"
version = "0.16.0"
description = "A binding generator for Rust"
authors = ["Jyun-Yan You <jyyou.tw@gmail.com>"]
license = "BSD-3-Clause"
build = "build.rs"
description = "A binding generator for Rust"
homepage = "https://github.com/crabtw/rust-bindgen"
repository = "https://github.com/crabtw/rust-bindgen"
keywords = ["bindings", "ffi", "code-generation"]
license = "BSD-3-Clause"
name = "bindgen"
readme = "README.md"
keywords = [ "bindings", "ffi", "code-generation" ]
build = "build.rs"
repository = "https://github.com/crabtw/rust-bindgen"
version = "0.16.0"

[dependencies]
aster = { version = "0.21.1", features = ["with-syntex"] }
quasi = { version = "0.15", features = ["with-syntex"] }
clippy = { version = "*", optional = true }
syntex_syntax = "0.38"
log = "0.3.*"
libc = "0.2.*"
clang-sys = "0.8.0"
[[bin]]
doc = false
name = "bindgen"

[build-dependencies]
quasi_codegen = "0.15"

[dependencies]
clang-sys = "0.8.0"
docopt = "0.6.82"
libc = "0.2.*"
log = "0.3.*"
rustc-serialize = "0.3.19"
syntex_syntax = "0.38"

[dependencies.aster]
features = ["with-syntex"]
version = "0.21.1"

[dependencies.clippy]
optional = true
version = "*"

[dependencies.quasi]
features = ["with-syntex"]
version = "0.15"

[features]
static = []
llvm_stable = []
static = []

[lib]
name = "bindgen"
path = "src/lib.rs"

[[bin]]
name = "bindgen"
doc = false

[[test]]
name = "tests"
Loading

0 comments on commit 0af8bd5

Please sign in to comment.