From f61f370343a52debb1fd22de69aeef09e73959a2 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 10 Oct 2022 18:37:51 +0200 Subject: [PATCH 1/4] Replace wrong-looking bracket No idea why or how that worked, but it definitely wasn't idiomatic. --- crates/fj-app/src/args.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-app/src/args.rs b/crates/fj-app/src/args.rs index b0828cb79..f60bf56a7 100644 --- a/crates/fj-app/src/args.rs +++ b/crates/fj-app/src/args.rs @@ -22,7 +22,7 @@ pub struct Args { pub parameters: Option, /// Model deviation tolerance - #[clap[short, long, parse(try_from_str = parse_tolerance)]] + #[clap(short, long, parse(try_from_str = parse_tolerance))] pub tolerance: Option, } From ce3a081ea7e62b28d97acf138efd2a36c6cd67a6 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 10 Oct 2022 18:40:44 +0200 Subject: [PATCH 2/4] Fix clap deprecation warnings --- crates/fj-app/src/args.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/fj-app/src/args.rs b/crates/fj-app/src/args.rs index f60bf56a7..15d5b04ca 100644 --- a/crates/fj-app/src/args.rs +++ b/crates/fj-app/src/args.rs @@ -18,11 +18,11 @@ pub struct Args { pub export: Option, /// Parameters for the model, each in the form `key=value` - #[clap(short, long, parse(try_from_str = parse_parameters))] + #[clap(short, long, value_parser = parse_parameters)] pub parameters: Option, /// Model deviation tolerance - #[clap(short, long, parse(try_from_str = parse_tolerance))] + #[clap(short, long, value_parser = parse_tolerance)] pub tolerance: Option, } From ce43b6a3b14685d0e084e42302223cb5092fed84 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 10 Oct 2022 18:41:56 +0200 Subject: [PATCH 3/4] Upgrade to latest clap version --- Cargo.lock | 20 ++++++-------------- crates/fj-app/Cargo.toml | 2 +- tools/automator/Cargo.toml | 2 +- tools/release-operator/Cargo.toml | 2 +- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ce9664685..daca4b3f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -396,26 +396,24 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.22" +version = "4.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" +checksum = "385007cbbed899260395a4107435fead4cad80684461b3cc78238bdcb0bad58f" dependencies = [ "atty", "bitflags", "clap_derive", "clap_lex", - "indexmap", "once_cell", "strsim", "termcolor", - "textwrap", ] [[package]] name = "clap_derive" -version = "3.2.18" +version = "4.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "db342ce9fda24fb191e2ed4e102055a4d381c1086a06630174cd8da8d5d917ce" dependencies = [ "heck", "proc-macro-error", @@ -426,9 +424,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" dependencies = [ "os_str_bytes", ] @@ -3368,12 +3366,6 @@ dependencies = [ "fj", ] -[[package]] -name = "textwrap" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" - [[package]] name = "thiserror" version = "1.0.37" diff --git a/crates/fj-app/Cargo.toml b/crates/fj-app/Cargo.toml index f7546e12f..f890b6e45 100644 --- a/crates/fj-app/Cargo.toml +++ b/crates/fj-app/Cargo.toml @@ -24,7 +24,7 @@ fj-viewer.workspace = true fj-window.workspace = true [dependencies.clap] -version = "3.2.22" +version = "4.0.12" features = ["derive"] [dependencies.figment] diff --git a/tools/automator/Cargo.toml b/tools/automator/Cargo.toml index 590903fc7..3fc7558ea 100644 --- a/tools/automator/Cargo.toml +++ b/tools/automator/Cargo.toml @@ -18,7 +18,7 @@ url = "2.3.0" path = "../autolib" [dependencies.clap] -version = "3.2.22" +version = "4.0.12" features = ["derive"] [dependencies.tokio] diff --git a/tools/release-operator/Cargo.toml b/tools/release-operator/Cargo.toml index 7a9c49d2d..c3667ed1a 100644 --- a/tools/release-operator/Cargo.toml +++ b/tools/release-operator/Cargo.toml @@ -24,7 +24,7 @@ version = "0.11.11" features = ["blocking"] [dependencies.clap] -version = "3.2.22" +version = "4.0.12" features = ["std", "derive", "env"] default_features = false From 39a901bc72d2c5cae6dde73185efcdc839cb63c0 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 10 Oct 2022 18:42:49 +0200 Subject: [PATCH 4/4] Fix clap deprecation warnings --- crates/fj-app/src/args.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/fj-app/src/args.rs b/crates/fj-app/src/args.rs index 15d5b04ca..e3879461e 100644 --- a/crates/fj-app/src/args.rs +++ b/crates/fj-app/src/args.rs @@ -7,22 +7,22 @@ use fj_math::Scalar; /// Fornjot - Experimental CAD System #[derive(clap::Parser)] -#[clap(version = env!("FJ_VERSION_STRING"))] +#[command(version = env!("FJ_VERSION_STRING"))] pub struct Args { /// The model to open - #[clap(short, long)] + #[arg(short, long)] pub model: Option, /// Export model to this path - #[clap(short, long)] + #[arg(short, long)] pub export: Option, /// Parameters for the model, each in the form `key=value` - #[clap(short, long, value_parser = parse_parameters)] + #[arg(short, long, value_parser = parse_parameters)] pub parameters: Option, /// Model deviation tolerance - #[clap(short, long, value_parser = parse_tolerance)] + #[arg(short, long, value_parser = parse_tolerance)] pub tolerance: Option, }