diff --git a/Cargo.lock b/Cargo.lock index f1db30d93c..607922baf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -96,15 +96,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anstream" version = "1.0.0" @@ -381,21 +372,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags 1.3.2", - "strsim 0.8.0", - "textwrap", - "unicode-width", - "vec_map", -] - [[package]] name = "clap" version = "4.6.0" @@ -414,7 +390,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", ] [[package]] @@ -1773,7 +1749,7 @@ name = "redox-initfs-tools" version = "0.2.0" dependencies = [ "anyhow", - "clap 4.6.0", + "clap", "env_logger", "log", "pathdiff", @@ -2207,12 +2183,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - [[package]] name = "strsim" version = "0.11.1" @@ -2278,15 +2248,6 @@ dependencies = [ "numtoa", ] -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - [[package]] name = "thiserror" version = "1.0.69" @@ -2389,12 +2350,6 @@ version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - [[package]] name = "unicode-xid" version = "0.2.6" @@ -2405,7 +2360,7 @@ checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" name = "usbctl" version = "0.1.0" dependencies = [ - "clap 2.34.0", + "clap", "common", "xhcid", ] @@ -2486,12 +2441,6 @@ dependencies = [ "redox_syscall 0.7.3", ] -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version-compare" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index 092776fa71..0162fa52cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,6 +75,7 @@ exclude = ["bootstrap"] [workspace.dependencies] anyhow = "1" bitflags = "2" +clap = "4" drm = "0.14.2" drm-sys = "0.8.1" libc = "0.2.181" diff --git a/drivers/usb/usbctl/Cargo.toml b/drivers/usb/usbctl/Cargo.toml index 9bfc00950c..5cc99f43e4 100644 --- a/drivers/usb/usbctl/Cargo.toml +++ b/drivers/usb/usbctl/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = "2.33" +clap.workspace = true xhcid = { path = "../xhcid" } common = { path = "../../common" } diff --git a/drivers/usb/usbctl/src/main.rs b/drivers/usb/usbctl/src/main.rs index 06f4549541..9b5773d901 100644 --- a/drivers/usb/usbctl/src/main.rs +++ b/drivers/usb/usbctl/src/main.rs @@ -1,37 +1,33 @@ -use clap::{App, Arg}; +use clap::{Arg, Command}; use xhcid_interface::{PortId, XhciClientHandle}; fn main() { common::init(); - let matches = App::new("usbctl") + let matches = Command::new("usbctl") .arg( - Arg::with_name("SCHEME") - .takes_value(true) + Arg::new("SCHEME") + .num_args(1) .required(true) .long("scheme") - .short("s"), + .short('s'), ) .subcommand( - App::new("port") - .arg(Arg::with_name("PORT").takes_value(true).required(true)) - .subcommand(App::new("status")) + Command::new("port") + .arg(Arg::new("PORT").num_args(1).required(true)) + .subcommand(Command::new("status")) .subcommand( - App::new("endpoint") - .arg( - Arg::with_name("ENDPOINT_NUM") - .takes_value(true) - .required(true), - ) - .subcommand(App::new("status")), + Command::new("endpoint") + .arg(Arg::new("ENDPOINT_NUM").num_args(1).required(true)) + .subcommand(Command::new("status")), ), ) .get_matches(); - let scheme = matches.value_of("SCHEME").expect("no scheme"); + let scheme = matches.get_one::("SCHEME").expect("no scheme"); if let Some(port_scmd_matches) = matches.subcommand_matches("port") { let port = port_scmd_matches - .value_of("PORT") + .get_one::("PORT") .expect("invalid utf-8 for PORT argument") .parse::() .expect("expected PORT ID"); @@ -44,7 +40,7 @@ fn main() { println!("{}", state.as_str()); } else if let Some(endp_scmd_matches) = port_scmd_matches.subcommand_matches("endpoint") { let endp_num = endp_scmd_matches - .value_of("ENDPOINT_NUM") + .get_one::("ENDPOINT_NUM") .expect("no valid ENDPOINT_NUM") .parse::() .expect("expected ENDPOINT_NUM to be an 8-bit integer"); diff --git a/initfs/tools/Cargo.toml b/initfs/tools/Cargo.toml index a3aeb048b7..278cd68495 100644 --- a/initfs/tools/Cargo.toml +++ b/initfs/tools/Cargo.toml @@ -18,7 +18,7 @@ path = "src/bin/dump.rs" [dependencies] anyhow.workspace = true -clap = {version = "4", features = ["cargo"]} +clap = {workspace = true, features = ["cargo"]} env_logger = "0.8" log.workspace = true pathdiff = "0.2.1"