Merge pull request #1197 from hannobraun/clap

Upgrade to latest version of clap
This commit is contained in:
Hanno Braun 2022-10-10 18:51:18 +02:00 committed by GitHub
commit bc949b1379
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 22 deletions

20
Cargo.lock generated
View File

@ -396,26 +396,24 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "3.2.22" version = "4.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" checksum = "385007cbbed899260395a4107435fead4cad80684461b3cc78238bdcb0bad58f"
dependencies = [ dependencies = [
"atty", "atty",
"bitflags", "bitflags",
"clap_derive", "clap_derive",
"clap_lex", "clap_lex",
"indexmap",
"once_cell", "once_cell",
"strsim", "strsim",
"termcolor", "termcolor",
"textwrap",
] ]
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "3.2.18" version = "4.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" checksum = "db342ce9fda24fb191e2ed4e102055a4d381c1086a06630174cd8da8d5d917ce"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro-error", "proc-macro-error",
@ -426,9 +424,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_lex" name = "clap_lex"
version = "0.2.4" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8"
dependencies = [ dependencies = [
"os_str_bytes", "os_str_bytes",
] ]
@ -3368,12 +3366,6 @@ dependencies = [
"fj", "fj",
] ]
[[package]]
name = "textwrap"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16"
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.37" version = "1.0.37"

View File

@ -24,7 +24,7 @@ fj-viewer.workspace = true
fj-window.workspace = true fj-window.workspace = true
[dependencies.clap] [dependencies.clap]
version = "3.2.22" version = "4.0.12"
features = ["derive"] features = ["derive"]
[dependencies.figment] [dependencies.figment]

View File

@ -7,22 +7,22 @@ use fj_math::Scalar;
/// Fornjot - Experimental CAD System /// Fornjot - Experimental CAD System
#[derive(clap::Parser)] #[derive(clap::Parser)]
#[clap(version = env!("FJ_VERSION_STRING"))] #[command(version = env!("FJ_VERSION_STRING"))]
pub struct Args { pub struct Args {
/// The model to open /// The model to open
#[clap(short, long)] #[arg(short, long)]
pub model: Option<PathBuf>, pub model: Option<PathBuf>,
/// Export model to this path /// Export model to this path
#[clap(short, long)] #[arg(short, long)]
pub export: Option<PathBuf>, pub export: Option<PathBuf>,
/// Parameters for the model, each in the form `key=value` /// Parameters for the model, each in the form `key=value`
#[clap(short, long, parse(try_from_str = parse_parameters))] #[arg(short, long, value_parser = parse_parameters)]
pub parameters: Option<Parameters>, pub parameters: Option<Parameters>,
/// Model deviation tolerance /// Model deviation tolerance
#[clap[short, long, parse(try_from_str = parse_tolerance)]] #[arg(short, long, value_parser = parse_tolerance)]
pub tolerance: Option<Tolerance>, pub tolerance: Option<Tolerance>,
} }

View File

@ -18,7 +18,7 @@ url = "2.3.0"
path = "../autolib" path = "../autolib"
[dependencies.clap] [dependencies.clap]
version = "3.2.22" version = "4.0.12"
features = ["derive"] features = ["derive"]
[dependencies.tokio] [dependencies.tokio]

View File

@ -24,7 +24,7 @@ version = "0.11.11"
features = ["blocking"] features = ["blocking"]
[dependencies.clap] [dependencies.clap]
version = "3.2.22" version = "4.0.12"
features = ["std", "derive", "env"] features = ["std", "derive", "env"]
default_features = false default_features = false