From 5e20a29b4fdc8a2d442d1093681b396dcb4b816b Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 7 Jan 2020 11:18:04 +0000 Subject: Add structopt dependency in version 0.3.7 This patch series replaces argparse with structopt in the argument handling code. As a first step, we need structopt as a dependency. Import subrepo structopt/:structopt at efbdda4753592e27bc430fb01f7b9650b2f3174d Import subrepo bitflags/:bitflags at 30668016aca6bd3b02c766e8347e0b4080d4c296 Import subrepo clap/:clap at 784524f7eb193e35f81082cc69454c8c21b948f7 Import subrepo heck/:heck at 093d56fbf001e1506e56dbfa38631d99b1066df1 Import subrepo proc-macro-error/:proc-macro-error at 6c4cfe79a622c5de8ae68557993542be46eacae2 Import subrepo proc-macro2/:proc-macro2 at d5d48eddca4566e5438e8a2cbed4a74e049544de Import subrepo quote/:quote at 727436c6c137b20f0f34dde5d8fda2679b9747ad Import subrepo rustversion/:rustversion at 0c5663313516263059ce9059ef81fc7a1cf655ca Import subrepo syn-mid/:syn-mid at 5d3d85414a9e6674e1857ec22a87b96e04a6851a Import subrepo syn/:syn at e87c27e87f6f4ef8919d0372bdb056d53ef0d8f3 Import subrepo textwrap/:textwrap at abcd618beae3f74841032aa5b53c1086b0a57ca2 Import subrepo unicode-segmentation/:unicode-segmentation at 637c9874c4fe0c205ff27787faf150a40295c6c3 Import subrepo unicode-width/:unicode-width at 3033826f8bf05e82724140a981d5941e48fce393 Import subrepo unicode-xid/:unicode-xid at 4baae9fffb156ba229665b972a9cd5991787ceb7 --- nitrocli/CHANGELOG.md | 5 +++ nitrocli/Cargo.lock | 119 +++++++++++++++++++++++++++++++++++++++++++------- nitrocli/Cargo.toml | 22 +++++++++- 3 files changed, 129 insertions(+), 17 deletions(-) (limited to 'nitrocli') diff --git a/nitrocli/CHANGELOG.md b/nitrocli/CHANGELOG.md index e331f2f..302b3c2 100644 --- a/nitrocli/CHANGELOG.md +++ b/nitrocli/CHANGELOG.md @@ -1,3 +1,8 @@ +Unreleased +---------- +- Reworked argument handling: + - Added `structopt` dependency in version `0.3.7` + 0.3.1 ----- - Added note about interaction with GnuPG to `README` file diff --git a/nitrocli/Cargo.lock b/nitrocli/Cargo.lock index 5f2a127..fc87abc 100644 --- a/nitrocli/Cargo.lock +++ b/nitrocli/Cargo.lock @@ -16,6 +16,10 @@ version = "0.2.2" name = "base32" version = "0.4.0" +[[package]] +name = "bitflags" +version = "1.2.1" + [[package]] name = "cc" version = "1.0.48" @@ -24,6 +28,15 @@ version = "1.0.48" name = "cfg-if" version = "0.1.10" +[[package]] +name = "clap" +version = "2.33.0" +dependencies = [ + "bitflags 1.2.1", + "textwrap 0.11.0", + "unicode-width 0.1.7", +] + [[package]] name = "getrandom" version = "0.1.13" @@ -33,6 +46,13 @@ dependencies = [ "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "heck" +version = "0.3.1" +dependencies = [ + "unicode-segmentation 1.6.0", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -57,6 +77,7 @@ dependencies = [ "nitrokey-test 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "nitrokey-test-state 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt 0.3.7", ] [[package]] @@ -81,9 +102,9 @@ name = "nitrokey-test" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7", + "quote 1.0.2", + "syn 1.0.12", ] [[package]] @@ -91,20 +112,40 @@ name = "nitrokey-test-state" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "proc-macro-error" +version = "0.4.4" +dependencies = [ + "proc-macro-error-attr 0.4.3", + "proc-macro2 1.0.7", + "quote 1.0.2", + "rustversion 1.0.1", + "syn 1.0.12", +] + +[[package]] +name = "proc-macro-error-attr" +version = "0.4.3" +dependencies = [ + "proc-macro2 1.0.7", + "quote 1.0.2", + "rustversion 1.0.1", + "syn 1.0.12", + "syn-mid 0.4.0", +] + [[package]] name = "proc-macro2" version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0", ] [[package]] name = "quote" version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7", ] [[package]] @@ -130,14 +171,57 @@ name = "regex-syntax" version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "rustversion" +version = "1.0.1" +dependencies = [ + "proc-macro2 1.0.7", + "quote 1.0.2", + "syn 1.0.12", +] + +[[package]] +name = "structopt" +version = "0.3.7" +dependencies = [ + "clap 2.33.0", + "structopt-derive 0.4.0", +] + +[[package]] +name = "structopt-derive" +version = "0.4.0" +dependencies = [ + "heck 0.3.1", + "proc-macro-error 0.4.4", + "proc-macro2 1.0.7", + "quote 1.0.2", + "syn 1.0.12", +] + [[package]] name = "syn" version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7", + "quote 1.0.2", + "unicode-xid 0.2.0", +] + +[[package]] +name = "syn-mid" +version = "0.4.0" +dependencies = [ + "proc-macro2 1.0.7", + "quote 1.0.2", + "syn 1.0.12", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +dependencies = [ + "unicode-width 0.1.7", ] [[package]] @@ -148,10 +232,17 @@ dependencies = [ "lazy_static 1.4.0", ] +[[package]] +name = "unicode-segmentation" +version = "1.6.0" + +[[package]] +name = "unicode-width" +version = "0.1.7" + [[package]] name = "unicode-xid" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasi" @@ -163,11 +254,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" "checksum nitrokey-test 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f3da0c2cedaa512f79fbc3ed45143a52c76c5edcca88d0823b967ff11d05fe37" "checksum nitrokey-test-state 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a59b732ed6d5212424ed31ec9649f05652bcbc38f45f2292b27a6044e7098803" -"checksum proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0319972dcae462681daf4da1adeeaa066e3ebd29c69be96c6abb1259d2ee2bcc" -"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" "checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" -"checksum syn 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ddc157159e2a7df58cd67b1cace10b8ed256a404fb0070593f137d8ba6bef4de" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" -"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" diff --git a/nitrocli/Cargo.toml b/nitrocli/Cargo.toml index a18cae9..2d5f484 100644 --- a/nitrocli/Cargo.toml +++ b/nitrocli/Cargo.toml @@ -55,6 +55,10 @@ version = "0.2" [dependencies.nitrokey] version = "0.4.0" +[dependencies.structopt] +version = "0.3.7" +default-features = false + [dev-dependencies.nitrokey-test] version = "0.3.1" @@ -67,11 +71,27 @@ version = "1" [patch.crates-io] argparse = { path = "../argparse" } base32 = { path = "../base32" } +bitflags = { path = "../bitflags" } cc = { path = "../cc" } cfg-if = { path = "../cfg-if" } +clap = { path = "../clap" } getrandom = { path = "../getrandom" } +heck = { path = "../heck" } +lazy_static = { path = "../lazy-static" } libc = { path = "../libc" } nitrokey = { path = "../nitrokey" } nitrokey-sys = { path = "../nitrokey-sys" } -lazy_static = { path = "../lazy-static" } +proc-macro-error = { path = "../proc-macro-error/proc-macro-error" } +proc-macro-error-attr = { path = "../proc-macro-error/proc-macro-error-attr" } +proc-macro2 = { path = "../proc-macro2" } +quote = { path = "../quote" } rand_core = { path = "../rand/rand_core" } +rustversion = { path = "../rustversion" } +structopt = { path = "../structopt" } +structopt-derive = { path = "../structopt/structopt-derive" } +syn = { path = "../syn" } +syn-mid = { path = "../syn-mid" } +textwrap = { path = "../textwrap" } +unicode-segmentation = { path = "../unicode-segmentation" } +unicode-width = { path = "../unicode-width" } +unicode-xid = { path = "../unicode-xid" } -- cgit v1.2.1