From 8ec5329c5e1f10617d3c965b1dd68aa245500985 Mon Sep 17 00:00:00 2001 From: "Brian L. Troutwine" Date: Mon, 16 Dec 2024 18:02:21 -0800 Subject: [PATCH 1/3] Update clap to 4.5 This commit updates the clap crate in use by lading to the latest release. Signed-off-by: Brian L. Troutwine --- Cargo.lock | 81 +++++++---------------------------------------- lading/Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 71 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1b1a1cfd0..33f1da750 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -443,21 +443,6 @@ dependencies = [ "half", ] -[[package]] -name = "clap" -version = "3.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" -dependencies = [ - "bitflags 1.3.2", - "clap_derive", - "clap_lex 0.2.4", - "indexmap 1.9.3", - "once_cell", - "strsim", - "textwrap", -] - [[package]] name = "clap" version = "4.5.22" @@ -465,6 +450,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69371e34337c4c984bbe322360c2547210bf632eb2814bbe78a6e87a2935bd2b" dependencies = [ "clap_builder", + "clap_derive", ] [[package]] @@ -474,29 +460,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e24c1b4099818523236a8ca881d2b45db98dadfb4625cf6608c12069fcbbde1" dependencies = [ "anstyle", - "clap_lex 0.7.3", + "clap_lex", + "strsim", ] [[package]] name = "clap_derive" -version = "3.2.25" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ - "heck 0.4.1", - "proc-macro-error", + "heck 0.5.0", "proc-macro2", "quote", - "syn 1.0.109", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", + "syn 2.0.90", ] [[package]] @@ -547,7 +524,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.5.22", + "clap", "criterion-plot", "is-terminal", "itertools", @@ -1567,7 +1544,7 @@ dependencies = [ "bollard", "byte-unit", "bytes", - "clap 3.2.25", + "clap", "flate2", "fuser", "futures", @@ -2009,12 +1986,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "os_str_bytes" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" - [[package]] name = "overload" version = "0.1.1" @@ -2185,30 +2156,6 @@ dependencies = [ "syn 1.0.109", ] -[[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 1.0.109", - "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.92" @@ -2866,9 +2813,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" @@ -2931,12 +2878,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "textwrap" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" - [[package]] name = "thiserror" version = "1.0.69" diff --git a/lading/Cargo.toml b/lading/Cargo.toml index 63e3ea765..48ff7bec3 100644 --- a/lading/Cargo.toml +++ b/lading/Cargo.toml @@ -25,7 +25,7 @@ average = { version = "0.15", default-features = false, features = [] } bollard = { version = "0.18", default-features = false, features = ["pipe", "http"] } byte-unit = { workspace = true } bytes = { workspace = true, features = ["std"] } -clap = { version = "3.2", default-features = false, features = [ +clap = { version = "4.5", default-features = false, features = [ "std", "suggestions", "derive", From 15c308547fe6a730ba5d0b9fb0994c8d0576eb78 Mon Sep 17 00:00:00 2001 From: "Brian L. Troutwine" Date: Mon, 16 Dec 2024 18:48:28 -0800 Subject: [PATCH 2/3] include help text Signed-off-by: Brian L. Troutwine --- lading/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/lading/Cargo.toml b/lading/Cargo.toml index 48ff7bec3..3bfea4d71 100644 --- a/lading/Cargo.toml +++ b/lading/Cargo.toml @@ -29,6 +29,7 @@ clap = { version = "4.5", default-features = false, features = [ "std", "suggestions", "derive", + "help", ] } flate2 = { version = "1.0.34", default-features = false, features = [ "rust_backend", From b12dd71234212a59282a9052635a7ba4564e8a0a Mon Sep 17 00:00:00 2001 From: "Brian L. Troutwine" Date: Mon, 16 Dec 2024 19:54:02 -0800 Subject: [PATCH 3/3] clap derive fixes Signed-off-by: Brian L. Troutwine --- lading/src/bin/lading.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lading/src/bin/lading.rs b/lading/src/bin/lading.rs index e86c7cfa5..cd488e9ca 100644 --- a/lading/src/bin/lading.rs +++ b/lading/src/bin/lading.rs @@ -130,17 +130,17 @@ impl FromStr for CliKeyValues { #[clap(group( ArgGroup::new("target") .required(true) - .args(&["target-path", "target-pid", "target-container", "no-target"]), + .args(&["target_path", "target_pid", "target_container", "no_target"]), ))] #[clap(group( ArgGroup::new("telemetry") .required(true) - .args(&["capture-path", "prometheus-addr", "prometheus-path"]), + .args(&["capture_path", "prometheus_addr", "prometheus_path"]), ))] #[clap(group( ArgGroup::new("experiment-duration") .required(false) - .args(&["experiment-duration-seconds", "experiment-duration-infinite"]), + .args(&["experiment_duration_seconds", "experiment_duration_infinite"]), ))] struct Opts { /// path on disk to the configuration file