mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-23 22:18:41 +00:00
Bump clap to v4.0.2 (#450)
* Rm unused dep clap from crate `binstalk` * Bump clap to v4.0.2 Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
111bfde2cb
commit
aa864fad59
4 changed files with 25 additions and 50 deletions
15
Cargo.lock
generated
15
Cargo.lock
generated
|
@ -114,7 +114,6 @@ dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"bzip2",
|
"bzip2",
|
||||||
"cargo_toml",
|
"cargo_toml",
|
||||||
"clap",
|
|
||||||
"compact_str",
|
"compact_str",
|
||||||
"crates_io_api",
|
"crates_io_api",
|
||||||
"detect-targets",
|
"detect-targets",
|
||||||
|
@ -316,26 +315,24 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "3.2.22"
|
version = "4.0.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750"
|
checksum = "31c9484ccdc4cb8e7b117cbd0eb150c7c0f04464854e4679aeb50ef03b32d003"
|
||||||
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.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65"
|
checksum = "ca689d7434ce44517a12a89456b2be4d1ea1cafcd8f581978c03d45f5a5c12a7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck",
|
"heck",
|
||||||
"proc-macro-error",
|
"proc-macro-error",
|
||||||
|
@ -346,9 +343,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",
|
||||||
]
|
]
|
||||||
|
|
|
@ -23,7 +23,7 @@ pkg-fmt = "zip"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
binstalk = { path = "../binstalk", version = "0.3.0" }
|
binstalk = { path = "../binstalk", version = "0.3.0" }
|
||||||
clap = { version = "3.2.22", features = ["derive"] }
|
clap = { version = "4.0.2", features = ["derive"] }
|
||||||
crates_io_api = { version = "0.8.1", default-features = false }
|
crates_io_api = { version = "0.8.1", default-features = false }
|
||||||
dirs = "4.0.0"
|
dirs = "4.0.0"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
|
|
|
@ -5,13 +5,19 @@ use binstalk::{
|
||||||
manifests::cargo_toml_binstall::PkgFmt,
|
manifests::cargo_toml_binstall::PkgFmt,
|
||||||
ops::resolve::{CrateName, VersionReqExt},
|
ops::resolve::{CrateName, VersionReqExt},
|
||||||
};
|
};
|
||||||
use clap::{builder::PossibleValue, AppSettings, ArgEnum, Parser};
|
use clap::{Parser, ValueEnum};
|
||||||
use log::LevelFilter;
|
use log::LevelFilter;
|
||||||
use reqwest::tls::Version;
|
use reqwest::tls::Version;
|
||||||
use semver::VersionReq;
|
use semver::VersionReq;
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
#[derive(Debug, Parser)]
|
||||||
#[clap(version, about = "Install a Rust binary... from binaries!", setting = AppSettings::ArgRequiredElseHelp)]
|
#[clap(
|
||||||
|
version,
|
||||||
|
about = "Install a Rust binary... from binaries!",
|
||||||
|
arg_required_else_help(true),
|
||||||
|
// Avoid conflict with version_req
|
||||||
|
disable_version_flag(true),
|
||||||
|
)]
|
||||||
pub struct Args {
|
pub struct Args {
|
||||||
/// Packages to install.
|
/// Packages to install.
|
||||||
///
|
///
|
||||||
|
@ -39,7 +45,11 @@ pub struct Args {
|
||||||
///
|
///
|
||||||
/// Cannot be used when multiple packages are installed at once, use the attached version
|
/// Cannot be used when multiple packages are installed at once, use the attached version
|
||||||
/// syntax in that case.
|
/// syntax in that case.
|
||||||
#[clap(help_heading = "Package selection", long = "version", parse(try_from_str = VersionReq::parse_from_cli))]
|
#[clap(
|
||||||
|
help_heading = "Package selection",
|
||||||
|
long = "version",
|
||||||
|
value_parser(VersionReq::parse_from_cli)
|
||||||
|
)]
|
||||||
pub version_req: Option<VersionReq>,
|
pub version_req: Option<VersionReq>,
|
||||||
|
|
||||||
/// Override binary target set.
|
/// Override binary target set.
|
||||||
|
@ -76,7 +86,7 @@ pub struct Args {
|
||||||
|
|
||||||
/// Override Cargo.toml package manifest pkg-fmt.
|
/// Override Cargo.toml package manifest pkg-fmt.
|
||||||
///
|
///
|
||||||
/// The availiable package formats are:
|
/// The available package formats are:
|
||||||
///
|
///
|
||||||
/// - tar: download format is TAR (uncompressed)
|
/// - tar: download format is TAR (uncompressed)
|
||||||
///
|
///
|
||||||
|
@ -91,22 +101,7 @@ pub struct Args {
|
||||||
/// - zip: Download format is Zip
|
/// - zip: Download format is Zip
|
||||||
///
|
///
|
||||||
/// - bin: Download format is raw / binary
|
/// - bin: Download format is raw / binary
|
||||||
#[clap(
|
#[clap(help_heading = "Overrides", long, value_name = "PKG_FMT")]
|
||||||
help_heading = "Overrides",
|
|
||||||
long,
|
|
||||||
value_name = "PKG_FMT",
|
|
||||||
possible_values = [
|
|
||||||
PossibleValue::new("tar").help(
|
|
||||||
"Download format is TAR (uncompressed)."
|
|
||||||
),
|
|
||||||
PossibleValue::new("tbz2").help("Download format is TAR + Bzip2."),
|
|
||||||
PossibleValue::new("tgz").help("Download format is TGZ (TAR + GZip)."),
|
|
||||||
PossibleValue::new("txz").help("Download format is TAR + XZ."),
|
|
||||||
PossibleValue::new("tzstd").help("Download format is TAR + Zstd."),
|
|
||||||
PossibleValue::new("zip").help("Download format is Zip."),
|
|
||||||
PossibleValue::new("bin").help("Download format is raw / binary."),
|
|
||||||
]
|
|
||||||
)]
|
|
||||||
pub pkg_fmt: Option<PkgFmt>,
|
pub pkg_fmt: Option<PkgFmt>,
|
||||||
|
|
||||||
/// Override Cargo.toml package manifest pkg-url.
|
/// Override Cargo.toml package manifest pkg-url.
|
||||||
|
@ -169,13 +164,9 @@ pub struct Args {
|
||||||
///
|
///
|
||||||
/// The default is not to require any minimum TLS version, and use the negotiated highest
|
/// The default is not to require any minimum TLS version, and use the negotiated highest
|
||||||
/// version available to both this client and the remote server.
|
/// version available to both this client and the remote server.
|
||||||
#[clap(help_heading = "Options", long, arg_enum, value_name = "VERSION")]
|
#[clap(help_heading = "Options", long, value_enum, value_name = "VERSION")]
|
||||||
pub min_tls_version: Option<TLSVersion>,
|
pub min_tls_version: Option<TLSVersion>,
|
||||||
|
|
||||||
/// Print help information
|
|
||||||
#[clap(help_heading = "Meta", short, long)]
|
|
||||||
pub help: bool,
|
|
||||||
|
|
||||||
/// Print version information
|
/// Print version information
|
||||||
#[clap(help_heading = "Meta", short = 'V')]
|
#[clap(help_heading = "Meta", short = 'V')]
|
||||||
pub version: bool,
|
pub version: bool,
|
||||||
|
@ -199,19 +190,7 @@ pub struct Args {
|
||||||
help_heading = "Meta",
|
help_heading = "Meta",
|
||||||
long,
|
long,
|
||||||
default_value = "info",
|
default_value = "info",
|
||||||
value_name = "LEVEL",
|
value_name = "LEVEL"
|
||||||
possible_values = [
|
|
||||||
PossibleValue::new("trace").help(
|
|
||||||
"Set to `trace` to print very low priority, often extremely verbose information."
|
|
||||||
),
|
|
||||||
PossibleValue::new("debug").help("Set to debug when submitting a bug report."),
|
|
||||||
PossibleValue::new("info").help("Set to info to only print useful information."),
|
|
||||||
PossibleValue::new("warn").help("Set to warn to only print on hazardous situations."),
|
|
||||||
PossibleValue::new("error").help("Set to error to only print serious errors."),
|
|
||||||
PossibleValue::new("off").help(
|
|
||||||
"Set to off to disable logging completely, this will also disable output from `cargo-install`."
|
|
||||||
),
|
|
||||||
]
|
|
||||||
)]
|
)]
|
||||||
pub log_level: LevelFilter,
|
pub log_level: LevelFilter,
|
||||||
|
|
||||||
|
@ -222,7 +201,7 @@ pub struct Args {
|
||||||
pub quiet: bool,
|
pub quiet: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, ArgEnum)]
|
#[derive(Debug, Copy, Clone, ValueEnum)]
|
||||||
pub enum TLSVersion {
|
pub enum TLSVersion {
|
||||||
#[clap(name = "1.2")]
|
#[clap(name = "1.2")]
|
||||||
Tls1_2,
|
Tls1_2,
|
||||||
|
|
|
@ -14,7 +14,6 @@ async-trait = "0.1.57"
|
||||||
bytes = "1.2.1"
|
bytes = "1.2.1"
|
||||||
bzip2 = "0.4.3"
|
bzip2 = "0.4.3"
|
||||||
cargo_toml = "0.12.2"
|
cargo_toml = "0.12.2"
|
||||||
clap = { version = "4.0.2", features = ["derive"] }
|
|
||||||
compact_str = { version = "0.6.0", features = ["serde"] }
|
compact_str = { version = "0.6.0", features = ["serde"] }
|
||||||
crates_io_api = { version = "0.8.1", default-features = false }
|
crates_io_api = { version = "0.8.1", default-features = false }
|
||||||
detect-targets = { version = "0.1.2", path = "../detect-targets" }
|
detect-targets = { version = "0.1.2", path = "../detect-targets" }
|
||||||
|
|
Loading…
Add table
Reference in a new issue