Migrate CLI argument parse to the clap derive API (#2390)

* Migrate CLI argument parsing to the derive API

* Fix docs

* Fix tests

* Use `override_usage`

* Update changelog
This commit is contained in:
Christian Poveda Ruiz
2023-01-18 12:38:19 -05:00
committed by GitHub
parent 9960524a62
commit d16cd43f97
5 changed files with 641 additions and 856 deletions
+2
View File
@@ -161,6 +161,8 @@
* Updated the `clang-sys` crate version to 1.4.0 to support clang 15.
* The return type is now ommited in signatures of functions returning `void`.
* Updated the `clap` dependency for `bindgen-cli` to 4.
* Rewrote the `bindgen-cli` argument parser which could introduce unexpected
behavior changes.
## Removed
Generated
+51
View File
@@ -156,12 +156,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39"
dependencies = [
"bitflags",
"clap_derive",
"clap_lex",
"is-terminal",
"once_cell",
"strsim 0.10.0",
"termcolor",
]
[[package]]
name = "clap_derive"
version = "4.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014"
dependencies = [
"heck",
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "clap_lex"
version = "0.3.0"
@@ -250,6 +265,12 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
[[package]]
name = "heck"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
[[package]]
name = "hermit-abi"
version = "0.1.19"
@@ -418,6 +439,12 @@ dependencies = [
"malloc_buf",
]
[[package]]
name = "once_cell"
version = "1.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
[[package]]
name = "os_str_bytes"
version = "6.2.0"
@@ -436,6 +463,30 @@ version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
[[package]]
name = "proc-macro-error"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote",
"syn",
"version_check",
]
[[package]]
name = "proc-macro-error-attr"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2",
"quote",
"version_check",
]
[[package]]
name = "proc-macro2"
version = "1.0.43"
+1 -1
View File
@@ -23,7 +23,7 @@ name = "bindgen"
[dependencies]
bindgen = { path = "../bindgen", version = "=0.63.0" }
shlex = "1"
clap = "4"
clap = { version = "4", features = ["derive"] }
env_logger = { version = "0.9.0", optional = true }
log = { version = "0.4", optional = true }
+586 -854
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -8,7 +8,7 @@ publish = false
bindgen = { path = "../bindgen" }
diff = "0.1"
shlex = "1"
clap = "4"
clap = { version = "4", features = ["derive"] }
tempfile = "3"
[features]