From 3db8da61280fc46b37542a837cfe1ab33db600bb Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Wed, 8 Feb 2023 10:22:46 +0800 Subject: [PATCH 1/5] Make clippy::needless-borrow happy Signed-off-by: hi-rustin --- src/cli/self_update.rs | 8 +-- src/config.rs | 2 +- src/diskio/mod.rs | 2 +- src/utils/utils.rs | 2 +- tests/cli-inst-interactive.rs | 6 +-- tests/cli-misc.rs | 8 +-- tests/cli-rustup.rs | 20 ++++---- tests/cli-self-upd.rs | 78 ++++++++++++++-------------- tests/cli-v2.rs | 16 +++--- tests/dist.rs | 96 +++++++++++++++++------------------ tests/dist_transactions.rs | 10 ++-- tests/mock/clitools.rs | 16 +++--- tests/mock/mod.rs | 2 +- 13 files changed, 133 insertions(+), 133 deletions(-) diff --git a/src/cli/self_update.rs b/src/cli/self_update.rs index 00f865591f..267f26c5e0 100644 --- a/src/cli/self_update.rs +++ b/src/cli/self_update.rs @@ -712,7 +712,7 @@ fn customize_install(mut opts: InstallOpts<'_>) -> Result> { fn install_bins() -> Result<()> { let bin_path = utils::cargo_home()?.join("bin"); let this_exe_path = utils::current_exe()?; - let rustup_path = bin_path.join(&format!("rustup{EXE_SUFFIX}")); + let rustup_path = bin_path.join(format!("rustup{EXE_SUFFIX}")); utils::ensure_dir_exists("bin", &bin_path, &|_: Notification<'_>| {})?; // NB: Even on Linux we can't just copy the new binary over the (running) @@ -1088,8 +1088,8 @@ fn parse_new_rustup_version(version: String) -> String { pub(crate) fn prepare_update() -> Result> { let cargo_home = utils::cargo_home()?; - let rustup_path = cargo_home.join(&format!("bin{MAIN_SEPARATOR}rustup{EXE_SUFFIX}")); - let setup_path = cargo_home.join(&format!("bin{MAIN_SEPARATOR}rustup-init{EXE_SUFFIX}")); + let rustup_path = cargo_home.join(format!("bin{MAIN_SEPARATOR}rustup{EXE_SUFFIX}")); + let setup_path = cargo_home.join(format!("bin{MAIN_SEPARATOR}rustup-init{EXE_SUFFIX}")); if !rustup_path.exists() { return Err(CLIError::NotSelfInstalled { p: cargo_home }.into()); @@ -1212,7 +1212,7 @@ pub(crate) fn check_rustup_update() -> Result<()> { pub(crate) fn cleanup_self_updater() -> Result<()> { let cargo_home = utils::cargo_home()?; - let setup = cargo_home.join(&format!("bin/rustup-init{EXE_SUFFIX}")); + let setup = cargo_home.join(format!("bin/rustup-init{EXE_SUFFIX}")); if setup.exists() { utils::remove_file("setup", &setup)?; diff --git a/src/config.rs b/src/config.rs index 4b9d0122e1..a4cce22eb3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -865,7 +865,7 @@ impl Cfg { // Filter out toolchains that don't track a release channel Ok(toolchains - .filter(|&(_, ref t)| t.as_ref().map(Toolchain::is_tracking).unwrap_or(false)) + .filter(|(_, ref t)| t.as_ref().map(Toolchain::is_tracking).unwrap_or(false)) .collect()) } diff --git a/src/diskio/mod.rs b/src/diskio/mod.rs index c53d17e545..a5e597c2d7 100644 --- a/src/diskio/mod.rs +++ b/src/diskio/mod.rs @@ -342,7 +342,7 @@ pub(crate) fn perform(item: &mut Item, chunk_complete_callback: F) write_file(&item.full_path, contents, item.mode) } FileBuffer::Threaded(ref mut contents) => { - write_file(&item.full_path, &contents, item.mode) + write_file(&item.full_path, contents, item.mode) } } } diff --git a/src/utils/utils.rs b/src/utils/utils.rs index c04fe32efa..96b9cc48e0 100644 --- a/src/utils/utils.rs +++ b/src/utils/utils.rs @@ -510,7 +510,7 @@ pub(crate) fn create_rustup_home() -> Result<()> { } let home = rustup_home_in_user_dir()?; - fs::create_dir_all(&home).context("unable to create ~/.rustup")?; + fs::create_dir_all(home).context("unable to create ~/.rustup")?; Ok(()) } diff --git a/tests/cli-inst-interactive.rs b/tests/cli-inst-interactive.rs index b75203f49a..6bec759af5 100644 --- a/tests/cli-inst-interactive.rs +++ b/tests/cli-inst-interactive.rs @@ -529,7 +529,7 @@ fn install_stops_if_rustc_exists() { .tempdir() .unwrap(); // Create fake executable - let fake_exe = temp_dir.path().join(&format!("{}{}", "rustc", EXE_SUFFIX)); + let fake_exe = temp_dir.path().join(format!("{}{}", "rustc", EXE_SUFFIX)); raw::append_file(&fake_exe, "").unwrap(); let temp_dir_path = temp_dir.path().to_str().unwrap(); @@ -560,7 +560,7 @@ fn install_stops_if_cargo_exists() { .tempdir() .unwrap(); // Create fake executable - let fake_exe = temp_dir.path().join(&format!("{}{}", "cargo", EXE_SUFFIX)); + let fake_exe = temp_dir.path().join(format!("{}{}", "cargo", EXE_SUFFIX)); raw::append_file(&fake_exe, "").unwrap(); let temp_dir_path = temp_dir.path().to_str().unwrap(); @@ -591,7 +591,7 @@ fn with_no_prompt_install_succeeds_if_rustc_exists() { .tempdir() .unwrap(); // Create fake executable - let fake_exe = temp_dir.path().join(&format!("{}{}", "rustc", EXE_SUFFIX)); + let fake_exe = temp_dir.path().join(format!("{}{}", "rustc", EXE_SUFFIX)); raw::append_file(&fake_exe, "").unwrap(); let temp_dir_path = temp_dir.path().to_str().unwrap(); diff --git a/tests/cli-misc.rs b/tests/cli-misc.rs index b71676aaeb..88fb692ac1 100644 --- a/tests/cli-misc.rs +++ b/tests/cli-misc.rs @@ -389,8 +389,8 @@ fn rustup_failed_path_search() { setup(&|config| { use std::env::consts::EXE_SUFFIX; - let rustup_path = config.exedir.join(&format!("rustup{EXE_SUFFIX}")); - let tool_path = config.exedir.join(&format!("fake_proxy{EXE_SUFFIX}")); + let rustup_path = config.exedir.join(format!("rustup{EXE_SUFFIX}")); + let tool_path = config.exedir.join(format!("fake_proxy{EXE_SUFFIX}")); utils::hardlink_file(&rustup_path, &tool_path) .expect("Failed to create fake proxy for test"); @@ -426,8 +426,8 @@ fn rustup_failed_path_search_toolchain() { setup(&|config| { use std::env::consts::EXE_SUFFIX; - let rustup_path = config.exedir.join(&format!("rustup{EXE_SUFFIX}")); - let tool_path = config.exedir.join(&format!("cargo-miri{EXE_SUFFIX}")); + let rustup_path = config.exedir.join(format!("rustup{EXE_SUFFIX}")); + let tool_path = config.exedir.join(format!("cargo-miri{EXE_SUFFIX}")); utils::hardlink_file(&rustup_path, &tool_path) .expect("Failed to create fake cargo-miri for test"); diff --git a/tests/cli-rustup.rs b/tests/cli-rustup.rs index 307fc66785..ea8a9c32fa 100644 --- a/tests/cli-rustup.rs +++ b/tests/cli-rustup.rs @@ -336,7 +336,7 @@ fn add_target() { ); expect_ok(config, &["rustup", "default", "nightly"]); expect_ok(config, &["rustup", "target", "add", clitools::CROSS_ARCH1]); - assert!(config.rustupdir.has(&path)); + assert!(config.rustupdir.has(path)); }); } @@ -378,13 +378,13 @@ fn add_remove_multiple_targets() { &this_host_triple(), clitools::CROSS_ARCH1 ); - assert!(config.rustupdir.has(&path)); + assert!(config.rustupdir.has(path)); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", &this_host_triple(), clitools::CROSS_ARCH2 ); - assert!(config.rustupdir.has(&path)); + assert!(config.rustupdir.has(path)); expect_ok( config, @@ -401,13 +401,13 @@ fn add_remove_multiple_targets() { &this_host_triple(), clitools::CROSS_ARCH1 ); - assert!(!config.rustupdir.has(&path)); + assert!(!config.rustupdir.has(path)); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", &this_host_triple(), clitools::CROSS_ARCH2 ); - assert!(!config.rustupdir.has(&path)); + assert!(!config.rustupdir.has(path)); }); } @@ -449,7 +449,7 @@ fn add_target_explicit() { clitools::CROSS_ARCH1, ], ); - assert!(config.rustupdir.has(&path)); + assert!(config.rustupdir.has(path)); }); } @@ -528,7 +528,7 @@ fn fallback_cargo_calls_correct_rustc() { let cargo_bin_path = config.cargodir.join("bin"); fs::create_dir_all(&cargo_bin_path).unwrap(); let rustc_path = cargo_bin_path.join(format!("rustc{EXE_SUFFIX}")); - fs::hard_link(&rustup_path, &rustc_path).unwrap(); + fs::hard_link(rustup_path, &rustc_path).unwrap(); // Install a custom toolchain and a nightly toolchain for the cargo fallback let path = config.customdir.join("custom-1"); @@ -1309,7 +1309,7 @@ fn add_component() { "toolchains/stable-{}/lib/rustlib/src/rust-src/foo.rs", this_host_triple() ); - assert!(config.rustupdir.has(&path)); + assert!(config.rustupdir.has(path)); }); } @@ -1527,7 +1527,7 @@ fn file_override_path_no_options() { let cwd = config.current_dir(); let toolchain_path = cwd.join("ephemeral"); let toolchain_bin = toolchain_path.join("bin"); - fs::create_dir_all(&toolchain_bin).unwrap(); + fs::create_dir_all(toolchain_bin).unwrap(); let toolchain_file = cwd.join("rust-toolchain.toml"); raw::write_file( @@ -1575,7 +1575,7 @@ fn file_override_path_xor_channel() { let cwd = config.current_dir(); let toolchain_path = cwd.join("ephemeral"); let toolchain_bin = toolchain_path.join("bin"); - fs::create_dir_all(&toolchain_bin).unwrap(); + fs::create_dir_all(toolchain_bin).unwrap(); let toolchain_file = cwd.join("rust-toolchain.toml"); raw::write_file( diff --git a/tests/cli-self-upd.rs b/tests/cli-self-upd.rs index 9e61514196..b0b84e95b0 100644 --- a/tests/cli-self-upd.rs +++ b/tests/cli-self-upd.rs @@ -111,7 +111,7 @@ fn install_twice() { with_saved_path(&|| { expect_ok(config, &["rustup-init", "-y"]); expect_ok(config, &["rustup-init", "-y"]); - let rustup = config.cargodir.join(&format!("bin/rustup{EXE_SUFFIX}")); + let rustup = config.cargodir.join(format!("bin/rustup{EXE_SUFFIX}")); assert!(rustup.exists()); }) }); @@ -147,15 +147,15 @@ fn uninstall_deletes_bins() { // no-modify-path isn't needed here, as the test-dir-path isn't present // in the registry, so the no-change code path will be triggered. expect_ok(config, &["rustup", "self", "uninstall", "-y"]); - let rustup = config.cargodir.join(&format!("bin/rustup{EXE_SUFFIX}")); - let rustc = config.cargodir.join(&format!("bin/rustc{EXE_SUFFIX}")); - let rustdoc = config.cargodir.join(&format!("bin/rustdoc{EXE_SUFFIX}")); - let cargo = config.cargodir.join(&format!("bin/cargo{EXE_SUFFIX}")); - let rust_lldb = config.cargodir.join(&format!("bin/rust-lldb{EXE_SUFFIX}")); - let rust_gdb = config.cargodir.join(&format!("bin/rust-gdb{EXE_SUFFIX}")); + let rustup = config.cargodir.join(format!("bin/rustup{EXE_SUFFIX}")); + let rustc = config.cargodir.join(format!("bin/rustc{EXE_SUFFIX}")); + let rustdoc = config.cargodir.join(format!("bin/rustdoc{EXE_SUFFIX}")); + let cargo = config.cargodir.join(format!("bin/cargo{EXE_SUFFIX}")); + let rust_lldb = config.cargodir.join(format!("bin/rust-lldb{EXE_SUFFIX}")); + let rust_gdb = config.cargodir.join(format!("bin/rust-gdb{EXE_SUFFIX}")); let rust_gdbgui = config .cargodir - .join(&format!("bin/rust-gdbgui{EXE_SUFFIX}")); + .join(format!("bin/rust-gdbgui{EXE_SUFFIX}")); assert!(!rustup.exists()); assert!(!rustc.exists()); assert!(!rustdoc.exists()); @@ -169,15 +169,15 @@ fn uninstall_deletes_bins() { #[test] fn uninstall_works_if_some_bins_dont_exist() { setup_empty_installed(&|config| { - let rustup = config.cargodir.join(&format!("bin/rustup{EXE_SUFFIX}")); - let rustc = config.cargodir.join(&format!("bin/rustc{EXE_SUFFIX}")); - let rustdoc = config.cargodir.join(&format!("bin/rustdoc{EXE_SUFFIX}")); - let cargo = config.cargodir.join(&format!("bin/cargo{EXE_SUFFIX}")); - let rust_lldb = config.cargodir.join(&format!("bin/rust-lldb{EXE_SUFFIX}")); - let rust_gdb = config.cargodir.join(&format!("bin/rust-gdb{EXE_SUFFIX}")); + let rustup = config.cargodir.join(format!("bin/rustup{EXE_SUFFIX}")); + let rustc = config.cargodir.join(format!("bin/rustc{EXE_SUFFIX}")); + let rustdoc = config.cargodir.join(format!("bin/rustdoc{EXE_SUFFIX}")); + let cargo = config.cargodir.join(format!("bin/cargo{EXE_SUFFIX}")); + let rust_lldb = config.cargodir.join(format!("bin/rust-lldb{EXE_SUFFIX}")); + let rust_gdb = config.cargodir.join(format!("bin/rust-gdb{EXE_SUFFIX}")); let rust_gdbgui = config .cargodir - .join(&format!("bin/rust-gdbgui{EXE_SUFFIX}")); + .join(format!("bin/rust-gdbgui{EXE_SUFFIX}")); fs::remove_file(&rustc).unwrap(); fs::remove_file(&cargo).unwrap(); @@ -221,8 +221,8 @@ fn uninstall_deletes_cargo_home() { #[test] fn uninstall_fails_if_not_installed() { setup_empty_installed(&|config| { - let rustup = config.cargodir.join(&format!("bin/rustup{EXE_SUFFIX}")); - fs::remove_file(&rustup).unwrap(); + let rustup = config.cargodir.join(format!("bin/rustup{EXE_SUFFIX}")); + fs::remove_file(rustup).unwrap(); expect_err( config, &["rustup", "self", "uninstall", "-y"], @@ -238,7 +238,7 @@ fn uninstall_fails_if_not_installed() { #[cfg_attr(target_os = "macos", ignore)] // FIXME #1515 fn uninstall_self_delete_works() { setup_empty_installed(&|config| { - let rustup = config.cargodir.join(&format!("bin/rustup{EXE_SUFFIX}")); + let rustup = config.cargodir.join(format!("bin/rustup{EXE_SUFFIX}")); let mut cmd = Command::new(rustup.clone()); cmd.args(["self", "uninstall", "-y"]); clitools::env(config, &mut cmd); @@ -250,14 +250,14 @@ fn uninstall_self_delete_works() { assert!(!rustup.exists()); assert!(!config.cargodir.exists()); - let rustc = config.cargodir.join(&format!("bin/rustc{EXE_SUFFIX}")); - let rustdoc = config.cargodir.join(&format!("bin/rustdoc{EXE_SUFFIX}")); - let cargo = config.cargodir.join(&format!("bin/cargo{EXE_SUFFIX}")); - let rust_lldb = config.cargodir.join(&format!("bin/rust-lldb{EXE_SUFFIX}")); - let rust_gdb = config.cargodir.join(&format!("bin/rust-gdb{EXE_SUFFIX}")); + let rustc = config.cargodir.join(format!("bin/rustc{EXE_SUFFIX}")); + let rustdoc = config.cargodir.join(format!("bin/rustdoc{EXE_SUFFIX}")); + let cargo = config.cargodir.join(format!("bin/cargo{EXE_SUFFIX}")); + let rust_lldb = config.cargodir.join(format!("bin/rust-lldb{EXE_SUFFIX}")); + let rust_gdb = config.cargodir.join(format!("bin/rust-gdb{EXE_SUFFIX}")); let rust_gdbgui = config .cargodir - .join(&format!("bin/rust-gdbgui{EXE_SUFFIX}")); + .join(format!("bin/rust-gdbgui{EXE_SUFFIX}")); assert!(!rustc.exists()); assert!(!rustdoc.exists()); assert!(!cargo.exists()); @@ -331,7 +331,7 @@ fn update_but_delete_existing_updater_first() { // The updater is stored in a known location let setup = config .cargodir - .join(&format!("bin/rustup-init{EXE_SUFFIX}")); + .join(format!("bin/rustup-init{EXE_SUFFIX}")); expect_ok(config, &["rustup-init", "-y", "--no-modify-path"]); @@ -340,7 +340,7 @@ fn update_but_delete_existing_updater_first() { raw::write_file(&setup, "").unwrap(); expect_ok(config, &["rustup", "self", "update"]); - let rustup = config.cargodir.join(&format!("bin/rustup{EXE_SUFFIX}")); + let rustup = config.cargodir.join(format!("bin/rustup{EXE_SUFFIX}")); assert!(rustup.exists()); }); } @@ -351,8 +351,8 @@ fn update_download_404() { expect_ok(config, &["rustup-init", "-y", "--no-modify-path"]); let trip = this_host_triple(); - let dist_dir = self_dist.join(&format!("archive/{TEST_VERSION}/{trip}")); - let dist_exe = dist_dir.join(&format!("rustup-init{EXE_SUFFIX}")); + let dist_dir = self_dist.join(format!("archive/{TEST_VERSION}/{trip}")); + let dist_exe = dist_dir.join(format!("rustup-init{EXE_SUFFIX}")); fs::remove_file(dist_exe).unwrap(); @@ -384,7 +384,7 @@ fn update_updates_rustup_bin() { update_setup(&|config, _| { expect_ok(config, &["rustup-init", "-y", "--no-modify-path"]); - let bin = config.cargodir.join(&format!("bin/rustup{EXE_SUFFIX}")); + let bin = config.cargodir.join(format!("bin/rustup{EXE_SUFFIX}")); let before_hash = calc_hash(&bin); // Running the self update command on the installed binary, @@ -444,7 +444,7 @@ fn rustup_self_updates_trivial() { expect_ok(config, &["rustup", "set", "auto-self-update", "enable"]); expect_ok(config, &["rustup-init", "-y", "--no-modify-path"]); - let bin = config.cargodir.join(&format!("bin/rustup{EXE_SUFFIX}")); + let bin = config.cargodir.join(format!("bin/rustup{EXE_SUFFIX}")); let before_hash = calc_hash(&bin); expect_ok(config, &["rustup", "update"]); @@ -461,7 +461,7 @@ fn rustup_self_updates_with_specified_toolchain() { expect_ok(config, &["rustup", "set", "auto-self-update", "enable"]); expect_ok(config, &["rustup-init", "-y", "--no-modify-path"]); - let bin = config.cargodir.join(&format!("bin/rustup{EXE_SUFFIX}")); + let bin = config.cargodir.join(format!("bin/rustup{EXE_SUFFIX}")); let before_hash = calc_hash(&bin); expect_ok(config, &["rustup", "update", "stable"]); @@ -477,7 +477,7 @@ fn rustup_no_self_update_with_specified_toolchain() { update_setup(&|config, _| { expect_ok(config, &["rustup-init", "-y", "--no-modify-path"]); - let bin = config.cargodir.join(&format!("bin/rustup{EXE_SUFFIX}")); + let bin = config.cargodir.join(format!("bin/rustup{EXE_SUFFIX}")); let before_hash = calc_hash(&bin); expect_ok(config, &["rustup", "update", "stable"]); @@ -526,7 +526,7 @@ fn updater_leaves_itself_for_later_deletion() { let setup = config .cargodir - .join(&format!("bin/rustup-init{EXE_SUFFIX}")); + .join(format!("bin/rustup-init{EXE_SUFFIX}")); assert!(setup.exists()); }); } @@ -542,7 +542,7 @@ fn updater_is_deleted_after_running_rustup() { let setup = config .cargodir - .join(&format!("bin/rustup-init{EXE_SUFFIX}")); + .join(format!("bin/rustup-init{EXE_SUFFIX}")); assert!(!setup.exists()); }); } @@ -558,7 +558,7 @@ fn updater_is_deleted_after_running_rustc() { let setup = config .cargodir - .join(&format!("bin/rustup-init{EXE_SUFFIX}")); + .join(format!("bin/rustup-init{EXE_SUFFIX}")); assert!(!setup.exists()); }); } @@ -582,7 +582,7 @@ fn as_rustup_setup() { clitools::setup(Scenario::Empty, &|config| { let init = config.exedir.join(format!("rustup-init{EXE_SUFFIX}")); let setup = config.exedir.join(format!("rustup-setup{EXE_SUFFIX}")); - fs::copy(&init, &setup).unwrap(); + fs::copy(init, setup).unwrap(); expect_ok( config, &[ @@ -708,11 +708,11 @@ fn readline_no_stdin() { fn rustup_init_works_with_weird_names() { // Browsers often rename bins to e.g. rustup-init(2).exe. clitools::setup(Scenario::SimpleV2, &|config| { - let old = config.exedir.join(&format!("rustup-init{EXE_SUFFIX}")); - let new = config.exedir.join(&format!("rustup-init(2){EXE_SUFFIX}")); + let old = config.exedir.join(format!("rustup-init{EXE_SUFFIX}")); + let new = config.exedir.join(format!("rustup-init(2){EXE_SUFFIX}")); utils::rename_file("test", &old, &new, &|_: Notification<'_>| {}).unwrap(); expect_ok(config, &["rustup-init(2)", "-y", "--no-modify-path"]); - let rustup = config.cargodir.join(&format!("bin/rustup{EXE_SUFFIX}")); + let rustup = config.cargodir.join(format!("bin/rustup{EXE_SUFFIX}")); assert!(rustup.exists()); }); } diff --git a/tests/cli-v2.rs b/tests/cli-v2.rs index 0ea2695185..ec75156b3c 100644 --- a/tests/cli-v2.rs +++ b/tests/cli-v2.rs @@ -662,7 +662,7 @@ fn add_target1() { this_host_triple(), clitools::CROSS_ARCH1 ); - assert!(config.rustupdir.has(&path)); + assert!(config.rustupdir.has(path)); }); } @@ -676,7 +676,7 @@ fn add_target2() { this_host_triple(), clitools::CROSS_ARCH2 ); - assert!(config.rustupdir.has(&path)); + assert!(config.rustupdir.has(path)); }); } @@ -690,13 +690,13 @@ fn add_all_targets() { this_host_triple(), clitools::CROSS_ARCH1 ); - assert!(config.rustupdir.has(&path)); + assert!(config.rustupdir.has(path)); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", this_host_triple(), clitools::CROSS_ARCH2 ); - assert!(config.rustupdir.has(&path)); + assert!(config.rustupdir.has(path)); }); } @@ -873,7 +873,7 @@ fn add_target_again() { this_host_triple(), clitools::CROSS_ARCH1 ); - assert!(config.rustupdir.has(&path)); + assert!(config.rustupdir.has(path)); }); } @@ -900,19 +900,19 @@ fn remove_target() { this_host_triple(), clitools::CROSS_ARCH1 ); - assert!(!config.rustupdir.has(&path)); + assert!(!config.rustupdir.has(path)); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib", this_host_triple(), clitools::CROSS_ARCH1 ); - assert!(!config.rustupdir.has(&path)); + assert!(!config.rustupdir.has(path)); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}", this_host_triple(), clitools::CROSS_ARCH1 ); - assert!(!config.rustupdir.has(&path)); + assert!(!config.rustupdir.has(path)); }); } diff --git a/tests/dist.rs b/tests/dist.rs index 770625f2f4..0930faf2a0 100644 --- a/tests/dist.rs +++ b/tests/dist.rs @@ -334,8 +334,8 @@ fn rename_component() { false, ) .unwrap(); - assert!(utils::path_exists(&prefix.path().join("bin/bonus"))); - assert!(!utils::path_exists(&prefix.path().join("bin/bobo"))); + assert!(utils::path_exists(prefix.path().join("bin/bonus"))); + assert!(!utils::path_exists(prefix.path().join("bin/bobo"))); change_channel_date(url, "nightly", "2016-02-02"); update_from_dist( url, @@ -348,8 +348,8 @@ fn rename_component() { false, ) .unwrap(); - assert!(utils::path_exists(&prefix.path().join("bin/bonus"))); - assert!(!utils::path_exists(&prefix.path().join("bin/bobo"))); + assert!(utils::path_exists(prefix.path().join("bin/bonus"))); + assert!(!utils::path_exists(prefix.path().join("bin/bobo"))); }, ); } @@ -400,8 +400,8 @@ fn rename_component_new() { ) .unwrap(); // Neither bonus nor bobo are installed at this point. - assert!(!utils::path_exists(&prefix.path().join("bin/bonus"))); - assert!(!utils::path_exists(&prefix.path().join("bin/bobo"))); + assert!(!utils::path_exists(prefix.path().join("bin/bonus"))); + assert!(!utils::path_exists(prefix.path().join("bin/bobo"))); // Now we move to day 2, where bobo is part of the set of things we want // to have installed change_channel_date(url, "nightly", "2016-02-02"); @@ -419,8 +419,8 @@ fn rename_component_new() { // As a result `bin/bonus` is present but not `bin/bobo` which we'd // expect since the bonus component installs `bin/bonus` regardless of // its name being `bobo` - assert!(!utils::path_exists(&prefix.path().join("bin/bobo"))); - assert!(utils::path_exists(&prefix.path().join("bin/bonus"))); + assert!(!utils::path_exists(prefix.path().join("bin/bobo"))); + assert!(utils::path_exists(prefix.path().join("bin/bonus"))); }, ); } @@ -563,7 +563,7 @@ fn setup_from_dist_server( currentprocess::with( Box::new(currentprocess::TestProcess::new( - &env::current_dir().unwrap(), + env::current_dir().unwrap(), &["rustup"], HashMap::default(), "", @@ -590,8 +590,8 @@ fn initial_install(comps: Compressions) { ) .unwrap(); - assert!(utils::path_exists(&prefix.path().join("bin/rustc"))); - assert!(utils::path_exists(&prefix.path().join("lib/libstd.rlib"))); + assert!(utils::path_exists(prefix.path().join("bin/rustc"))); + assert!(utils::path_exists(prefix.path().join("lib/libstd.rlib"))); }); } @@ -630,8 +630,8 @@ fn test_uninstall() { .unwrap(); uninstall(toolchain, prefix, temp_cfg, &|_| ()).unwrap(); - assert!(!utils::path_exists(&prefix.path().join("bin/rustc"))); - assert!(!utils::path_exists(&prefix.path().join("lib/libstd.rlib"))); + assert!(!utils::path_exists(prefix.path().join("bin/rustc"))); + assert!(!utils::path_exists(prefix.path().join("lib/libstd.rlib"))); }); } @@ -654,11 +654,11 @@ fn uninstall_removes_config_file() { ) .unwrap(); assert!(utils::path_exists( - &prefix.manifest_file("multirust-config.toml") + prefix.manifest_file("multirust-config.toml") )); uninstall(toolchain, prefix, temp_cfg, &|_| ()).unwrap(); assert!(!utils::path_exists( - &prefix.manifest_file("multirust-config.toml") + prefix.manifest_file("multirust-config.toml") )); }); } @@ -684,7 +684,7 @@ fn upgrade() { .unwrap(); assert_eq!( "2016-02-01", - fs::read_to_string(&prefix.path().join("bin/rustc")).unwrap() + fs::read_to_string(prefix.path().join("bin/rustc")).unwrap() ); change_channel_date(url, "nightly", "2016-02-02"); update_from_dist( @@ -700,7 +700,7 @@ fn upgrade() { .unwrap(); assert_eq!( "2016-02-02", - fs::read_to_string(&prefix.path().join("bin/rustc")).unwrap() + fs::read_to_string(prefix.path().join("bin/rustc")).unwrap() ); }); } @@ -760,7 +760,7 @@ fn unavailable_component() { false, ) .unwrap(); - assert!(utils::path_exists(&prefix.path().join("bin/bonus"))); + assert!(utils::path_exists(prefix.path().join("bin/bonus"))); change_channel_date(url, "nightly", "2016-02-02"); // Update without bonus, should fail. @@ -821,7 +821,7 @@ fn unavailable_component_from_profile() { false, ) .unwrap(); - assert!(utils::path_exists(&prefix.path().join("bin/rustc"))); + assert!(utils::path_exists(prefix.path().join("bin/rustc"))); change_channel_date(url, "nightly", "2016-02-02"); // Update without rustc, should fail. @@ -901,7 +901,7 @@ fn removed_component() { false, ) .unwrap(); - assert!(utils::path_exists(&prefix.path().join("bin/bonus"))); + assert!(utils::path_exists(prefix.path().join("bin/bonus"))); // Update without bonus, should fail with RequestedComponentsUnavailable change_channel_date(url, "nightly", "2016-02-02"); @@ -976,10 +976,10 @@ fn unavailable_components_is_target() { .unwrap(); assert!(utils::path_exists( - &prefix.path().join("lib/i686-apple-darwin/libstd.rlib") + prefix.path().join("lib/i686-apple-darwin/libstd.rlib") )); assert!(utils::path_exists( - &prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") + prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") )); // Update without rust-std @@ -1058,8 +1058,8 @@ fn unavailable_components_with_same_target() { false, ) .unwrap(); - assert!(utils::path_exists(&prefix.path().join("bin/rustc"))); - assert!(utils::path_exists(&prefix.path().join("lib/libstd.rlib"))); + assert!(utils::path_exists(prefix.path().join("bin/rustc"))); + assert!(utils::path_exists(prefix.path().join("lib/libstd.rlib"))); // Update without rust-std and rustc change_channel_date(url, "nightly", "2016-02-02"); @@ -1123,10 +1123,10 @@ fn update_preserves_extensions() { .unwrap(); assert!(utils::path_exists( - &prefix.path().join("lib/i686-apple-darwin/libstd.rlib") + prefix.path().join("lib/i686-apple-darwin/libstd.rlib") )); assert!(utils::path_exists( - &prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") + prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") )); change_channel_date(url, "nightly", "2016-02-02"); @@ -1143,10 +1143,10 @@ fn update_preserves_extensions() { .unwrap(); assert!(utils::path_exists( - &prefix.path().join("lib/i686-apple-darwin/libstd.rlib") + prefix.path().join("lib/i686-apple-darwin/libstd.rlib") )); assert!(utils::path_exists( - &prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") + prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") )); }); } @@ -1217,10 +1217,10 @@ fn add_extensions_for_initial_install() { ) .unwrap(); assert!(utils::path_exists( - &prefix.path().join("lib/i686-apple-darwin/libstd.rlib") + prefix.path().join("lib/i686-apple-darwin/libstd.rlib") )); assert!(utils::path_exists( - &prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") + prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") )); }); } @@ -1270,10 +1270,10 @@ fn add_extensions_for_same_manifest() { .unwrap(); assert!(utils::path_exists( - &prefix.path().join("lib/i686-apple-darwin/libstd.rlib") + prefix.path().join("lib/i686-apple-darwin/libstd.rlib") )); assert!(utils::path_exists( - &prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") + prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") )); }); } @@ -1327,10 +1327,10 @@ fn add_extensions_for_upgrade() { .unwrap(); assert!(utils::path_exists( - &prefix.path().join("lib/i686-apple-darwin/libstd.rlib") + prefix.path().join("lib/i686-apple-darwin/libstd.rlib") )); assert!(utils::path_exists( - &prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") + prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") )); }); } @@ -1436,7 +1436,7 @@ fn add_extensions_does_not_remove_other_components() { ) .unwrap(); - assert!(utils::path_exists(&prefix.path().join("bin/rustc"))); + assert!(utils::path_exists(prefix.path().join("bin/rustc"))); }); } @@ -1520,10 +1520,10 @@ fn remove_extensions_for_same_manifest() { .unwrap(); assert!(!utils::path_exists( - &prefix.path().join("lib/i686-apple-darwin/libstd.rlib") + prefix.path().join("lib/i686-apple-darwin/libstd.rlib") )); assert!(utils::path_exists( - &prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") + prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") )); }); } @@ -1583,10 +1583,10 @@ fn remove_extensions_for_upgrade() { .unwrap(); assert!(!utils::path_exists( - &prefix.path().join("lib/i686-apple-darwin/libstd.rlib") + prefix.path().join("lib/i686-apple-darwin/libstd.rlib") )); assert!(utils::path_exists( - &prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") + prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") )); }); } @@ -1677,7 +1677,7 @@ fn remove_extension_not_in_manifest_but_is_already_installed() { false, ) .unwrap(); - assert!(utils::path_exists(&prefix.path().join("bin/bonus"))); + assert!(utils::path_exists(prefix.path().join("bin/bonus"))); change_channel_date(url, "nightly", "2016-02-02"); @@ -1828,7 +1828,7 @@ fn remove_extensions_does_not_remove_other_components() { ) .unwrap(); - assert!(utils::path_exists(&prefix.path().join("bin/rustc"))); + assert!(utils::path_exists(prefix.path().join("bin/rustc"))); }); } @@ -1886,10 +1886,10 @@ fn add_and_remove_for_upgrade() { .unwrap(); assert!(utils::path_exists( - &prefix.path().join("lib/i686-apple-darwin/libstd.rlib") + prefix.path().join("lib/i686-apple-darwin/libstd.rlib") )); assert!(!utils::path_exists( - &prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") + prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") )); }); } @@ -1944,10 +1944,10 @@ fn add_and_remove() { .unwrap(); assert!(utils::path_exists( - &prefix.path().join("lib/i686-apple-darwin/libstd.rlib") + prefix.path().join("lib/i686-apple-darwin/libstd.rlib") )); assert!(!utils::path_exists( - &prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") + prefix.path().join("lib/i686-unknown-linux-gnu/libstd.rlib") )); }); } @@ -2036,7 +2036,7 @@ fn unable_to_download_component() { temp_cfg| { let path = url.to_file_path().unwrap(); let path = path.join("dist/2016-02-02/rustc-nightly-x86_64-apple-darwin.tar.gz"); - fs::remove_file(&path).unwrap(); + fs::remove_file(path).unwrap(); let err = update_from_dist( url, @@ -2229,7 +2229,7 @@ fn handle_corrupt_partial_downloads() { ) .unwrap(); - assert!(utils::path_exists(&prefix.path().join("bin/rustc"))); - assert!(utils::path_exists(&prefix.path().join("lib/libstd.rlib"))); + assert!(utils::path_exists(prefix.path().join("bin/rustc"))); + assert!(utils::path_exists(prefix.path().join("lib/libstd.rlib"))); }); } diff --git a/tests/dist_transactions.rs b/tests/dist_transactions.rs index 5dc8f1d5ce..c4728513a5 100644 --- a/tests/dist_transactions.rs +++ b/tests/dist_transactions.rs @@ -33,7 +33,7 @@ fn add_file() { drop(file); assert_eq!( - fs::read_to_string(&prefix.path().join("foo/bar")).unwrap(), + fs::read_to_string(prefix.path().join("foo/bar")).unwrap(), "test" ); } @@ -76,7 +76,7 @@ fn add_file_that_exists() { let notify = |_: Notification<'_>| (); let mut tx = Transaction::new(prefix, &tmpcfg, ¬ify); - fs::create_dir_all(&prefixdir.path().join("foo")).unwrap(); + fs::create_dir_all(prefixdir.path().join("foo")).unwrap(); utils::write_file("", &prefixdir.path().join("foo/bar"), "").unwrap(); let err = tx.add_file("c", PathBuf::from("foo/bar")).unwrap_err(); @@ -164,7 +164,7 @@ fn copy_file_that_exists() { let srcpath = srcdir.path().join("bar"); utils::write_file("", &srcpath, "").unwrap(); - fs::create_dir_all(&prefixdir.path().join("foo")).unwrap(); + fs::create_dir_all(prefixdir.path().join("foo")).unwrap(); utils::write_file("", &prefixdir.path().join("foo/bar"), "").unwrap(); let err = tx @@ -484,7 +484,7 @@ fn write_file_then_rollback() { .unwrap(); drop(tx); - assert!(!utils::is_file(&prefix.path().join("foo/bar"))); + assert!(!utils::is_file(prefix.path().join("foo/bar"))); } #[test] @@ -678,7 +678,7 @@ fn do_multiple_op_transaction(rollback: bool) { let path5 = prefix.path().join(&relpath5); let path6 = prefix.path().join(&relpath6); let path7 = prefix.path().join(&relpath7); - let path8 = prefix.path().join(&relpath8); + let path8 = prefix.path().join(relpath8); let srcpath1 = srcdir.path().join(&relpath1); fs::create_dir_all(srcpath1.parent().unwrap()).unwrap(); diff --git a/tests/mock/clitools.rs b/tests/mock/clitools.rs index 4b68366f65..348cc5f7dd 100644 --- a/tests/mock/clitools.rs +++ b/tests/mock/clitools.rs @@ -160,7 +160,7 @@ pub fn setup(s: Scenario, f: &dyn Fn(&mut Config)) { let rls_path = config.exedir.join(format!("rls{EXE_SUFFIX}")); let rust_lldb_path = config.exedir.join(format!("rust-lldb{EXE_SUFFIX}")); - copy_binary(&build_path, &rustup_path).unwrap(); + copy_binary(build_path, &rustup_path).unwrap(); hard_link(&rustup_path, setup_path).unwrap(); hard_link(&rustup_path, rustc_path).unwrap(); hard_link(&rustup_path, cargo_path).unwrap(); @@ -199,13 +199,13 @@ pub fn setup(s: Scenario, f: &dyn Fn(&mut Config)) { fn create_local_update_server(self_dist: &Path, config: &mut Config, version: &str) { let trip = this_host_triple(); - let dist_dir = self_dist.join(&format!("archive/{version}/{trip}")); - let dist_exe = dist_dir.join(&format!("rustup-init{EXE_SUFFIX}")); - let rustup_bin = config.exedir.join(&format!("rustup-init{EXE_SUFFIX}")); + let dist_dir = self_dist.join(format!("archive/{version}/{trip}")); + let dist_exe = dist_dir.join(format!("rustup-init{EXE_SUFFIX}")); + let rustup_bin = config.exedir.join(format!("rustup-init{EXE_SUFFIX}")); fs::create_dir_all(dist_dir).unwrap(); output_release_file(self_dist, "1", version); - fs::copy(&rustup_bin, &dist_exe).unwrap(); + fs::copy(rustup_bin, dist_exe).unwrap(); let root_url = format!("file://{}", self_dist.display()); config.rustup_update_root = Some(root_url); @@ -239,8 +239,8 @@ pub fn self_update_setup(f: &dyn Fn(&Config, &Path), version: &str) { create_local_update_server(self_dist, config, version); let trip = this_host_triple(); - let dist_dir = self_dist.join(&format!("archive/{version}/{trip}")); - let dist_exe = dist_dir.join(&format!("rustup-init{EXE_SUFFIX}")); + let dist_dir = self_dist.join(format!("archive/{version}/{trip}")); + let dist_exe = dist_dir.join(format!("rustup-init{EXE_SUFFIX}")); // Modify the exe so it hashes different raw::append_file(&dist_exe, "").unwrap(); @@ -1317,7 +1317,7 @@ fn mock_bin(name: &str, version: &str, version_hash: &str) -> Vec { // Create a temp directory to hold the source and the output let tempdir = tempfile::Builder::new().prefix("rustup").tempdir().unwrap(); let source_path = tempdir.path().join("in.rs"); - let dest_path = tempdir.path().join(&format!("out{EXE_SUFFIX}")); + let dest_path = tempdir.path().join(format!("out{EXE_SUFFIX}")); // Write the source let source = include_bytes!("mock_bin_src.rs"); diff --git a/tests/mock/mod.rs b/tests/mock/mod.rs index 637a6ab415..f636f90d79 100644 --- a/tests/mock/mod.rs +++ b/tests/mock/mod.rs @@ -137,7 +137,7 @@ impl MockFile { let path = path.join(&self.path); match self.contents { Contents::Dir(ref files) => { - for &(ref name, ref contents) in files { + for (name, contents) in files { let fname = path.join(name); contents.build(&fname); } From 19213c82349251635706eaa16105fddbdf68e5d7 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Wed, 8 Feb 2023 10:30:58 +0800 Subject: [PATCH 2/5] Make clippy::needless-lifetimes happy Signed-off-by: hi-rustin --- src/cli/rustup_mode.rs | 2 +- src/dist/component/package.rs | 8 ++++---- src/dist/dist.rs | 16 ++++++++-------- tests/cli-self-upd.rs | 28 +++++++--------------------- 4 files changed, 20 insertions(+), 34 deletions(-) diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs index 3907a5c4a0..a8b36567ae 100644 --- a/src/cli/rustup_mode.rs +++ b/src/cli/rustup_mode.rs @@ -747,7 +747,7 @@ pub(crate) fn cli() -> App<'static, 'static> { ) } -fn verbose_arg<'a, 'b>(help: &'b str) -> Arg<'a, 'b> { +fn verbose_arg(help: &str) -> Arg<'_, '_> { Arg::with_name("verbose") .help(help) .takes_value(false) diff --git a/src/dist/component/package.rs b/src/dist/component/package.rs index 7dd932da15..dfccc661c8 100644 --- a/src/dist/component/package.rs +++ b/src/dist/component/package.rs @@ -284,10 +284,10 @@ enum DirStatus { Pending(Vec), } -fn unpack_without_first_dir<'a, R: Read>( +fn unpack_without_first_dir( archive: &mut tar::Archive, path: &Path, - notify_handler: Option<&'a dyn Fn(Notification<'_>)>, + notify_handler: Option<&dyn Fn(Notification<'_>)>, ) -> Result<()> { let entries = archive.entries()?; let effective_max_ram = match effective_limits::memory_limit() { @@ -347,10 +347,10 @@ fn unpack_without_first_dir<'a, R: Read>( /// true if either no sender_entry was provided, or the incremental file /// has been fully dispatched. - fn flush_ios<'a, R: std::io::Read, P: AsRef>( + fn flush_ios>( io_executor: &mut dyn Executor, directories: &mut HashMap, - mut sender_entry: Option<&mut SenderEntry<'a, '_, R>>, + mut sender_entry: Option<&mut SenderEntry<'_, '_, R>>, full_path: P, ) -> Result { let mut result = sender_entry.is_none(); diff --git a/src/dist/dist.rs b/src/dist/dist.rs index ddbe10f8ba..c5dc89ce5a 100644 --- a/src/dist/dist.rs +++ b/src/dist/dist.rs @@ -650,8 +650,8 @@ pub(crate) fn valid_profile_names() -> String { // an upgrade then all the existing components will be upgraded. // // Returns the manifest's hash if anything changed. -pub(crate) fn update_from_dist<'a>( - download: DownloadCfg<'a>, +pub(crate) fn update_from_dist( + download: DownloadCfg<'_>, update_hash: Option<&Path>, toolchain: &ToolchainDesc, profile: Option, @@ -694,8 +694,8 @@ pub(crate) fn update_from_dist<'a>( res } -fn update_from_dist_<'a>( - download: DownloadCfg<'a>, +fn update_from_dist_( + download: DownloadCfg<'_>, update_hash: Option<&Path>, toolchain: &ToolchainDesc, profile: Option, @@ -829,8 +829,8 @@ fn update_from_dist_<'a>( } } -fn try_update_from_dist_<'a>( - download: DownloadCfg<'a>, +fn try_update_from_dist_( + download: DownloadCfg<'_>, update_hash: Option<&Path>, toolchain: &ToolchainDesc, profile: Option, @@ -1017,8 +1017,8 @@ fn try_update_from_dist_<'a>( } } -pub(crate) fn dl_v2_manifest<'a>( - download: DownloadCfg<'a>, +pub(crate) fn dl_v2_manifest( + download: DownloadCfg<'_>, update_hash: Option<&Path>, toolchain: &ToolchainDesc, ) -> Result> { diff --git a/tests/cli-self-upd.rs b/tests/cli-self-upd.rs index b0b84e95b0..01e644e2be 100644 --- a/tests/cli-self-upd.rs +++ b/tests/cli-self-upd.rs @@ -153,9 +153,7 @@ fn uninstall_deletes_bins() { let cargo = config.cargodir.join(format!("bin/cargo{EXE_SUFFIX}")); let rust_lldb = config.cargodir.join(format!("bin/rust-lldb{EXE_SUFFIX}")); let rust_gdb = config.cargodir.join(format!("bin/rust-gdb{EXE_SUFFIX}")); - let rust_gdbgui = config - .cargodir - .join(format!("bin/rust-gdbgui{EXE_SUFFIX}")); + let rust_gdbgui = config.cargodir.join(format!("bin/rust-gdbgui{EXE_SUFFIX}")); assert!(!rustup.exists()); assert!(!rustc.exists()); assert!(!rustdoc.exists()); @@ -175,9 +173,7 @@ fn uninstall_works_if_some_bins_dont_exist() { let cargo = config.cargodir.join(format!("bin/cargo{EXE_SUFFIX}")); let rust_lldb = config.cargodir.join(format!("bin/rust-lldb{EXE_SUFFIX}")); let rust_gdb = config.cargodir.join(format!("bin/rust-gdb{EXE_SUFFIX}")); - let rust_gdbgui = config - .cargodir - .join(format!("bin/rust-gdbgui{EXE_SUFFIX}")); + let rust_gdbgui = config.cargodir.join(format!("bin/rust-gdbgui{EXE_SUFFIX}")); fs::remove_file(&rustc).unwrap(); fs::remove_file(&cargo).unwrap(); @@ -255,9 +251,7 @@ fn uninstall_self_delete_works() { let cargo = config.cargodir.join(format!("bin/cargo{EXE_SUFFIX}")); let rust_lldb = config.cargodir.join(format!("bin/rust-lldb{EXE_SUFFIX}")); let rust_gdb = config.cargodir.join(format!("bin/rust-gdb{EXE_SUFFIX}")); - let rust_gdbgui = config - .cargodir - .join(format!("bin/rust-gdbgui{EXE_SUFFIX}")); + let rust_gdbgui = config.cargodir.join(format!("bin/rust-gdbgui{EXE_SUFFIX}")); assert!(!rustc.exists()); assert!(!rustdoc.exists()); assert!(!cargo.exists()); @@ -329,9 +323,7 @@ fn update_but_not_installed() { fn update_but_delete_existing_updater_first() { update_setup(&|config, _| { // The updater is stored in a known location - let setup = config - .cargodir - .join(format!("bin/rustup-init{EXE_SUFFIX}")); + let setup = config.cargodir.join(format!("bin/rustup-init{EXE_SUFFIX}")); expect_ok(config, &["rustup-init", "-y", "--no-modify-path"]); @@ -524,9 +516,7 @@ fn updater_leaves_itself_for_later_deletion() { expect_ok(config, &["rustup", "update", "nightly"]); expect_ok(config, &["rustup", "self", "update"]); - let setup = config - .cargodir - .join(format!("bin/rustup-init{EXE_SUFFIX}")); + let setup = config.cargodir.join(format!("bin/rustup-init{EXE_SUFFIX}")); assert!(setup.exists()); }); } @@ -540,9 +530,7 @@ fn updater_is_deleted_after_running_rustup() { expect_ok(config, &["rustup", "update", "nightly"]); - let setup = config - .cargodir - .join(format!("bin/rustup-init{EXE_SUFFIX}")); + let setup = config.cargodir.join(format!("bin/rustup-init{EXE_SUFFIX}")); assert!(!setup.exists()); }); } @@ -556,9 +544,7 @@ fn updater_is_deleted_after_running_rustc() { expect_ok(config, &["rustc", "--version"]); - let setup = config - .cargodir - .join(format!("bin/rustup-init{EXE_SUFFIX}")); + let setup = config.cargodir.join(format!("bin/rustup-init{EXE_SUFFIX}")); assert!(!setup.exists()); }); } From f3bd0eeead9e25901ec63a3c9b559e8890dddadc Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Wed, 8 Feb 2023 10:18:04 +0800 Subject: [PATCH 3/5] Use beta and give more explanation Signed-off-by: hi-rustin --- CONTRIBUTING.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 432bfacf99..edc026f124 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,10 @@ 1. Fork it! 2. Create your feature branch: `git checkout -b my-new-feature` 3. Test it: `cargo test` -4. Lint it: `cargo +nightly clippy --all --all-targets -- -D warnings` +4. Lint it: `cargo +beta clippy --all --all-targets -- -D warnings` +> We use `cargo clippy` to ensure high-quality code and to enforce a set of best practices for Rust programming. However, not all lints provided by `cargo clippy` are relevant or applicable to our project. +> We may choose to ignore some lints if they are unstable, experimental, or specific to our project. +> If you are unsure about a lint, please ask us in the [rustup Discord channel](https://discord.com/channels/442252698964721669/463480252723888159). 5. Commit your changes: `git commit -am 'Add some feature'` 6. Push to the branch: `git push origin my-new-feature` 7. Submit a pull request :D From 8332528ac61a28875400d4b891eba81e148284a3 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Sat, 11 Feb 2023 15:42:38 +0800 Subject: [PATCH 4/5] Add test for cli ui Signed-off-by: hi-rustin --- Cargo.lock | 276 +++++++++++++++++- Cargo.toml | 1 + tests/cli-ui.rs | 13 + .../cli-ui/rustup-init_help_flag_stdout.toml | 27 ++ .../rustup_check_cmd_help_flag_stdout.toml | 13 + ...stup_completions_cmd_help_flag_stdout.toml | 138 +++++++++ ...omponent_cmd_add_cmd_help_flag_stdout.toml | 21 ++ ...mponent_cmd_list_cmd_help_flag_stdout.toml | 18 ++ ...onent_cmd_remove_cmd_help_flag_stdout.toml | 21 ++ .../rustup_default_cmd_help_flag_stdout.toml | 21 ++ .../rustup_doc_cmd_help_flag_stdout.toml | 45 +++ tests/cli-ui/rustup_help_cmd_stdout.toml | 48 +++ tests/cli-ui/rustup_help_flag_stdout.toml | 48 +++ .../rustup_man_cmd_help_flag_stdout.toml | 20 ++ ...override_cmd_add_cmd_help_flag_stdout.toml | 20 ++ .../rustup_override_cmd_help_flag_stdout.toml | 40 +++ ...verride_cmd_list_cmd_help_flag_stdout.toml | 13 + ...rride_cmd_remove_cmd_help_flag_stdout.toml | 24 ++ ...override_cmd_set_cmd_help_flag_stdout.toml | 20 ++ ...erride_cmd_unset_cmd_help_flag_stdout.toml | 24 ++ .../rustup_run_cmd_help_flag_stdout.toml | 34 +++ .../rustup_self_cmd_help_flag_stdout.toml | 19 ++ ...lf_cmd_uninstall_cmd_help_flag_stdout.toml | 14 + ..._self_cmd_update_cmd_help_flag_stdout.toml | 13 + ...md_upgrade-data _cmd_help_flag_stdout.toml | 13 + ...auto-self-update_cmd_help_flag_stdout.toml | 17 ++ ...cmd_default-host_cmd_help_flag_stdout.toml | 17 ++ .../rustup_set_cmd_help_flag_stdout.toml | 19 ++ ..._set_cmd_profile_cmd_help_flag_stdout.toml | 17 ++ ...active-toolchain_cmd_help_flag_stdout.toml | 23 ++ .../rustup_show_cmd_help_flag_stdout.toml | 30 ++ ...up_show_cmd_home_cmd_help_flag_stdout.toml | 13 + ...up_show_cmd_keys_cmd_help_flag_stdout.toml | 13 + ...show_cmd_profile_cmd_help_flag_stdout.toml | 13 + ...p_target_cmd_add_cmd_help_flag_stdout.toml | 20 ++ .../rustup_target_cmd_help_flag_stdout.toml | 19 ++ ..._target_cmd_list_cmd_help_flag_stdout.toml | 18 ++ ...arget_cmd_remove_cmd_help_flag_stdout.toml | 20 ++ ...rustup_toolchain_cmd_help_flag_stdout.toml | 62 ++++ ...hain_cmd_install_cmd_help_flag_stdout.toml | 27 ++ ...olchain_cmd_link_cmd_help_flag_stdout.toml | 36 +++ ...olchain_cmd_list_cmd_help_flag_stdout.toml | 14 + ...in_cmd_uninstall_cmd_help_flag_stdout.toml | 17 ++ .../rustup_update_cmd_help_flag_stdout.toml | 29 ++ .../rustup_which_cmd_help_flag_stdout.toml | 20 ++ 45 files changed, 1383 insertions(+), 5 deletions(-) create mode 100644 tests/cli-ui.rs create mode 100644 tests/cli-ui/rustup-init_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_check_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_completions_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_component_cmd_add_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_component_cmd_list_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_component_cmd_remove_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_default_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_doc_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_help_cmd_stdout.toml create mode 100644 tests/cli-ui/rustup_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_man_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_override_cmd_add_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_override_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_override_cmd_list_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_override_cmd_remove_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_override_cmd_set_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_override_cmd_unset_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_run_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_self_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_self_cmd_uninstall_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_self_cmd_update_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_self_cmd_upgrade-data _cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_set_cmd_auto-self-update_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_set_cmd_default-host_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_set_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_set_cmd_profile_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_show_cmd_active-toolchain_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_show_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_show_cmd_home_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_show_cmd_keys_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_show_cmd_profile_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_target_cmd_add_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_target_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_target_cmd_list_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_target_cmd_remove_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_toolchain_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_toolchain_cmd_install_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_toolchain_cmd_link_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_toolchain_cmd_list_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_toolchain_cmd_uninstall_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_update_cmd_help_flag_stdout.toml create mode 100644 tests/cli-ui/rustup_which_cmd_help_flag_stdout.toml diff --git a/Cargo.lock b/Cargo.lock index e512f6786f..aebd4d6af2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -350,12 +350,38 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "concolor" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "318d6c16e73b3a900eb212ad6a82fc7d298c5ab8184c7a9998646455bc474a16" +dependencies = [ + "bitflags", + "concolor-query", + "is-terminal", +] + +[[package]] +name = "concolor-query" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82a90734b3d5dcf656e7624cca6bce9c3a90ee11f900e80141a7427ccfb3d317" + [[package]] name = "const-oid" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "279bc8fc53f788a75c7804af68237d1fce02cde1e275a886a4b320604dc2aeda" +[[package]] +name = "content_inspector" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38" +dependencies = [ + "memchr", +] + [[package]] name = "core-foundation" version = "0.9.3" @@ -658,6 +684,12 @@ dependencies = [ "url", ] +[[package]] +name = "dunce" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c" + [[package]] name = "dyn-clone" version = "1.0.10" @@ -794,6 +826,27 @@ dependencies = [ "url", ] +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "fastrand" version = "1.8.0" @@ -823,7 +876,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -985,6 +1038,12 @@ dependencies = [ "time 0.3.17", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "group" version = "0.9.0" @@ -1039,6 +1098,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "hmac" version = "0.11.0" @@ -1092,6 +1157,22 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "humantime-serde" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c" +dependencies = [ + "humantime", + "serde", +] + [[package]] name = "hyper" version = "0.14.23" @@ -1205,12 +1286,34 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "io-lifetimes" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" +dependencies = [ + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "ipnet" version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +[[package]] +name = "is-terminal" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0a45d56fe973d6db23972bf5bc46f988a4a2385deac9cc29572f09daef" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys 0.45.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -1314,6 +1417,12 @@ dependencies = [ "cc", ] +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + [[package]] name = "lock_api" version = "0.4.9" @@ -1400,7 +1509,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1433,6 +1542,21 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" +[[package]] +name = "nom8" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" +dependencies = [ + "memchr", +] + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + [[package]] name = "num-bigint" version = "0.2.6" @@ -1580,6 +1704,16 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "os_pipe" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a53dbb20faf34b16087a931834cba2d7a73cc74af2b7ef345a4c8324e2409a12" +dependencies = [ + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "p256" version = "0.8.1" @@ -1611,7 +1745,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1995,6 +2129,20 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustix" +version = "0.36.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.45.0", +] + [[package]] name = "rustls" version = "0.20.8" @@ -2068,6 +2216,7 @@ dependencies = [ "thiserror", "threadpool", "toml", + "trycmd", "url", "wait-timeout", "walkdir", @@ -2104,7 +2253,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2239,6 +2388,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2307,6 +2465,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + [[package]] name = "signature" version = "1.3.2" @@ -2317,6 +2481,12 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "similar" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" + [[package]] name = "simple_asn1" version = "0.4.1" @@ -2349,6 +2519,34 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "snapbox" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34eced5a65e76d5a00047986a83c65f80dc666faa27b5138f331659e2ca6bcf5" +dependencies = [ + "concolor", + "content_inspector", + "dunce", + "filetime", + "libc", + "normalize-line-endings", + "os_pipe", + "similar", + "snapbox-macros", + "tempfile", + "wait-timeout", + "walkdir", + "windows-sys 0.42.0", + "yansi", +] + +[[package]] +name = "snapbox-macros" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "485e65c1203eb37244465e857d15a26d3a85a5410648ccb53b18bd44cb3a7336" + [[package]] name = "socket2" version = "0.4.7" @@ -2624,7 +2822,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "socket2", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2683,6 +2881,28 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6a7712b49e1775fb9a7b998de6635b299237f48b404dde71704f2e0e7f37e5" +dependencies = [ + "indexmap", + "nom8", + "serde", + "serde_spanned", + "toml_datetime", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -2715,6 +2935,22 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +[[package]] +name = "trycmd" +version = "0.14.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "522dcafb4bf113bcf83e4f47a0499ea1f6798877439e6a0e96cf087a2abe97dc" +dependencies = [ + "glob", + "humantime", + "humantime-serde", + "rayon", + "serde", + "shlex", + "snapbox", + "toml_edit", +] + [[package]] name = "twofish" version = "0.5.0" @@ -2989,6 +3225,30 @@ dependencies = [ "windows_x86_64_msvc", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.1" @@ -3090,6 +3350,12 @@ dependencies = [ "lzma-sys", ] +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + [[package]] name = "zeroize" version = "1.3.0" diff --git a/Cargo.toml b/Cargo.toml index 2fa10226ed..86c2680c89 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,6 +66,7 @@ url = "2.1" wait-timeout = "0.2" xz2 = "0.1.3" zstd = "0.11" +trycmd = "0.14.11" [dependencies.retry] default-features = false diff --git a/tests/cli-ui.rs b/tests/cli-ui.rs new file mode 100644 index 0000000000..e5e59cef28 --- /dev/null +++ b/tests/cli-ui.rs @@ -0,0 +1,13 @@ +use std::fs; + +#[test] +fn ui_tests() { + let t = trycmd::TestCases::new(); + let rustup_init = trycmd::cargo::cargo_bin("rustup-init"); + let rustup = trycmd::cargo::cargo_bin("rustup"); + t.register_bin("rustup-init", &rustup_init); + // Copy rustup-init to rustup so that the tests can run it. + fs::copy(&rustup_init, &rustup).unwrap(); + t.register_bin("rustup", &rustup); + t.case("tests/cli-ui/*.toml"); +} diff --git a/tests/cli-ui/rustup-init_help_flag_stdout.toml b/tests/cli-ui/rustup-init_help_flag_stdout.toml new file mode 100644 index 0000000000..d1c400eace --- /dev/null +++ b/tests/cli-ui/rustup-init_help_flag_stdout.toml @@ -0,0 +1,27 @@ +bin.name = "rustup-init" +args = ["--help"] +status.code = 0 +stdout = """ +rustup-init [..] +The installer for rustup + +USAGE: + rustup-init [FLAGS] [OPTIONS] + +FLAGS: + -v, --verbose Enable verbose output + -q, --quiet Disable progress output + -y Disable confirmation prompt. + --no-update-default-toolchain Don't update any existing default toolchain after install + --no-modify-path Don't configure the PATH environment variable + -h, --help Prints help information + -V, --version Prints version information + +OPTIONS: + --default-host Choose a default host triple + --default-toolchain Choose a default toolchain to install + --profile [default: default] [possible values: minimal, default, complete] + -c, --component ... Component name to also install + -t, --target ... Target name to also install +""" +stderr = "" diff --git a/tests/cli-ui/rustup_check_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_check_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..aed5975c46 --- /dev/null +++ b/tests/cli-ui/rustup_check_cmd_help_flag_stdout.toml @@ -0,0 +1,13 @@ +bin.name = "rustup" +args = ["check","--help"] +stdout = """ +rustup-check +Check for updates to Rust toolchains and rustup + +USAGE: + rustup check + +FLAGS: + -h, --help Prints help information +""" +stderr = "" diff --git a/tests/cli-ui/rustup_completions_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_completions_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..a1132cedf2 --- /dev/null +++ b/tests/cli-ui/rustup_completions_cmd_help_flag_stdout.toml @@ -0,0 +1,138 @@ +bin.name = "rustup" +args = ["completions","--help"] +stdout = """ +rustup-completions +Generate tab-completion scripts for your shell + +USAGE: + rustup completions [ARGS] + +FLAGS: + -h, --help Prints help information + +ARGS: + [possible values: zsh, bash, fish, powershell, elvish] + [possible values: rustup, cargo] + +DISCUSSION: + Enable tab completion for Bash, Fish, Zsh, or PowerShell + The script is output on `stdout`, allowing one to re-direct the + output to the file of their choosing. Where you place the file + will depend on which shell, and which operating system you are + using. Your particular configuration may also determine where + these scripts need to be placed. + + Here are some common set ups for the three supported shells under + Unix and similar operating systems (such as GNU/Linux). + + BASH: + + Completion files are commonly stored in `/etc/bash_completion.d/` for + system-wide commands, but can be stored in + `~/.local/share/bash-completion/completions` for user-specific commands. + Run the command: + + $ mkdir -p ~/.local/share/bash-completion/completions + $ rustup completions bash >> ~/.local/share/bash-completion/completions/rustup + + This installs the completion script. You may have to log out and + log back in to your shell session for the changes to take effect. + + BASH (macOS/Homebrew): + + Homebrew stores bash completion files within the Homebrew directory. + With the `bash-completion` brew formula installed, run the command: + + $ mkdir -p $(brew --prefix)/etc/bash_completion.d + $ rustup completions bash > $(brew --prefix)/etc/bash_completion.d/rustup.bash-completion + + FISH: + + Fish completion files are commonly stored in + `$HOME/.config/fish/completions`. Run the command: + + $ mkdir -p ~/.config/fish/completions + $ rustup completions fish > ~/.config/fish/completions/rustup.fish + + This installs the completion script. You may have to log out and + log back in to your shell session for the changes to take effect. + + ZSH: + + ZSH completions are commonly stored in any directory listed in + your `$fpath` variable. To use these completions, you must either + add the generated script to one of those directories, or add your + own to this list. + + Adding a custom directory is often the safest bet if you are + unsure of which directory to use. First create the directory; for + this example we'll create a hidden directory inside our `$HOME` + directory: + + $ mkdir ~/.zfunc + + Then add the following lines to your `.zshrc` just before + `compinit`: + + fpath+=~/.zfunc + + Now you can install the completions script using the following + command: + + $ rustup completions zsh > ~/.zfunc/_rustup + + You must then either log out and log back in, or simply run + + $ exec zsh + + for the new completions to take effect. + + CUSTOM LOCATIONS: + + Alternatively, you could save these files to the place of your + choosing, such as a custom directory inside your $HOME. Doing so + will require you to add the proper directives, such as `source`ing + inside your login script. Consult your shells documentation for + how to add such directives. + + POWERSHELL: + + The powershell completion scripts require PowerShell v5.0+ (which + comes with Windows 10, but can be downloaded separately for windows 7 + or 8.1). + + First, check if a profile has already been set + + PS C:/> Test-Path $profile + + If the above command returns `False` run the following + + PS C:/> New-Item -path $profile -type file -force + + Now open the file provided by `$profile` (if you used the + `New-Item` command it will be + `${env:USERPROFILE}/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1` + + Next, we either save the completions file into our profile, or + into a separate file and source it inside our profile. To save the + completions into our profile simply use + + PS C:/> rustup completions powershell >> +${env:USERPROFILE}/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 + + CARGO: + + Rustup can also generate a completion script for `cargo`. The script output + by `rustup` will source the completion script distributed with your default + toolchain. Not all shells are currently supported. Here are examples for + the currently supported shells. + + BASH: + + $ rustup completions bash cargo >> ~/.local/share/bash-completion/completions/cargo + + ZSH: + + $ rustup completions zsh cargo > ~/.zfunc/_cargo +""" +stderr = "" diff --git a/tests/cli-ui/rustup_component_cmd_add_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_component_cmd_add_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..1412528393 --- /dev/null +++ b/tests/cli-ui/rustup_component_cmd_add_cmd_help_flag_stdout.toml @@ -0,0 +1,21 @@ +bin.name = "rustup" +args = ["component","add","--help"] +stdout = """ +rustup-component-add +Add a component to a Rust toolchain + +USAGE: + rustup component add [OPTIONS] ... + +FLAGS: + -h, --help Prints help information + +OPTIONS: + --target + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` + +ARGS: + ... +""" +stderr = "" diff --git a/tests/cli-ui/rustup_component_cmd_list_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_component_cmd_list_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..82bd149449 --- /dev/null +++ b/tests/cli-ui/rustup_component_cmd_list_cmd_help_flag_stdout.toml @@ -0,0 +1,18 @@ +bin.name = "rustup" +args = ["component","list","--help"] +stdout = """ +rustup-component-list +List installed and available components + +USAGE: + rustup component list [FLAGS] [OPTIONS] + +FLAGS: + -h, --help Prints help information + --installed List only installed components + +OPTIONS: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` +""" +stderr = "" diff --git a/tests/cli-ui/rustup_component_cmd_remove_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_component_cmd_remove_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..4419ec694e --- /dev/null +++ b/tests/cli-ui/rustup_component_cmd_remove_cmd_help_flag_stdout.toml @@ -0,0 +1,21 @@ +bin.name = "rustup" +args = ["component","remove","--help"] +stdout = """ +rustup-component-remove +Remove a component from a Rust toolchain + +USAGE: + rustup component remove [OPTIONS] ... + +FLAGS: + -h, --help Prints help information + +OPTIONS: + --target + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` + +ARGS: + ... +""" +stderr = "" diff --git a/tests/cli-ui/rustup_default_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_default_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..b9c3c488a8 --- /dev/null +++ b/tests/cli-ui/rustup_default_cmd_help_flag_stdout.toml @@ -0,0 +1,21 @@ +bin.name = "rustup" +args = ["default","--help"] +stdout = """ +rustup-default +Set the default toolchain + +USAGE: + rustup default [toolchain] + +FLAGS: + -h, --help Prints help information + +ARGS: + Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see `rustup help + toolchain` + +DISCUSSION: + Sets the default toolchain to the one specified. If the toolchain + is not already installed then it is installed first. +""" +stderr = "" diff --git a/tests/cli-ui/rustup_doc_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_doc_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..0db427e6e5 --- /dev/null +++ b/tests/cli-ui/rustup_doc_cmd_help_flag_stdout.toml @@ -0,0 +1,45 @@ +bin.name = "rustup" +args = ["doc","--help"] +stdout = """ +rustup-doc +Open the documentation for the current toolchain + +USAGE: + rustup doc [FLAGS] [OPTIONS] [topic] + +FLAGS: + --alloc The Rust core allocation and collections library + --book The Rust Programming Language book + --cargo The Cargo Book + --core The Rust Core Library + --edition-guide The Rust Edition Guide + --embedded-book The Embedded Rust Book + -h, --help Prints help information + --nomicon The Dark Arts of Advanced and Unsafe Rust Programming + --path Only print the path to the documentation + --proc_macro A support library for macro authors when defining new macros + --reference The Rust Reference + --rust-by-example A collection of runnable examples that illustrate various Rust concepts and standard + libraries + --rustc The compiler for the Rust programming language + --rustdoc Documentation generator for Rust projects + --std Standard library API documentation + --test Support code for rustc's built in unit-test and micro-benchmarking framework + --unstable-book The Unstable Book + +OPTIONS: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` + +ARGS: + Topic such as 'core', 'fn', 'usize', 'eprintln!', 'core::arch', 'alloc::format!', 'std::fs', + 'std::fs::read_dir', 'std::io::Bytes', 'std::iter::Sum', 'std::io::error::Result' etc... + +DISCUSSION: + Opens the documentation for the currently active toolchain with + the default browser. + + By default, it opens the documentation index. Use the various + flags to open specific pieces of documentation. +""" +stderr = "" diff --git a/tests/cli-ui/rustup_help_cmd_stdout.toml b/tests/cli-ui/rustup_help_cmd_stdout.toml new file mode 100644 index 0000000000..b5d761f974 --- /dev/null +++ b/tests/cli-ui/rustup_help_cmd_stdout.toml @@ -0,0 +1,48 @@ +bin.name = "rustup" +args = ["help"] +status.code = 0 +stdout = """ +rustup [..] +The Rust toolchain installer + +USAGE: + rustup [FLAGS] [+toolchain] + +FLAGS: + -v, --verbose Enable verbose output + -q, --quiet Disable progress output + -h, --help Prints help information + -V, --version Prints version information + +ARGS: + <+toolchain> release channel (e.g. +stable) or custom toolchain to set override + +SUBCOMMANDS: + show Show the active and installed toolchains or profiles + update Update Rust toolchains and rustup + check Check for updates to Rust toolchains and rustup + default Set the default toolchain + toolchain Modify or query the installed toolchains + target Modify a toolchain's supported targets + component Modify a toolchain's installed components + override Modify directory toolchain overrides + run Run a command with an environment configured for a given toolchain + which Display which binary will be run for a given command + doc Open the documentation for the current toolchain + man View the man page for a given command + self Modify the rustup installation + set Alter rustup settings + completions Generate tab-completion scripts for your shell + help Prints this message or the help of the given subcommand(s) + +DISCUSSION: + Rustup installs The Rust Programming Language from the official + release channels, enabling you to easily switch between stable, + beta, and nightly compilers and keep them updated. It makes + cross-compiling simpler with binary builds of the standard library + for common platforms. + + If you are new to Rust consider running `rustup doc --book` to + learn Rust. +""" +stderr = "" diff --git a/tests/cli-ui/rustup_help_flag_stdout.toml b/tests/cli-ui/rustup_help_flag_stdout.toml new file mode 100644 index 0000000000..2315668b39 --- /dev/null +++ b/tests/cli-ui/rustup_help_flag_stdout.toml @@ -0,0 +1,48 @@ +bin.name = "rustup" +args = ["--help"] +status.code = 0 +stdout = """ +rustup [..] +The Rust toolchain installer + +USAGE: + rustup [FLAGS] [+toolchain] + +FLAGS: + -v, --verbose Enable verbose output + -q, --quiet Disable progress output + -h, --help Prints help information + -V, --version Prints version information + +ARGS: + <+toolchain> release channel (e.g. +stable) or custom toolchain to set override + +SUBCOMMANDS: + show Show the active and installed toolchains or profiles + update Update Rust toolchains and rustup + check Check for updates to Rust toolchains and rustup + default Set the default toolchain + toolchain Modify or query the installed toolchains + target Modify a toolchain's supported targets + component Modify a toolchain's installed components + override Modify directory toolchain overrides + run Run a command with an environment configured for a given toolchain + which Display which binary will be run for a given command + doc Open the documentation for the current toolchain + man View the man page for a given command + self Modify the rustup installation + set Alter rustup settings + completions Generate tab-completion scripts for your shell + help Prints this message or the help of the given subcommand(s) + +DISCUSSION: + Rustup installs The Rust Programming Language from the official + release channels, enabling you to easily switch between stable, + beta, and nightly compilers and keep them updated. It makes + cross-compiling simpler with binary builds of the standard library + for common platforms. + + If you are new to Rust consider running `rustup doc --book` to + learn Rust. +""" +stderr = "" diff --git a/tests/cli-ui/rustup_man_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_man_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..d9d3a2f8c6 --- /dev/null +++ b/tests/cli-ui/rustup_man_cmd_help_flag_stdout.toml @@ -0,0 +1,20 @@ +bin.name = "rustup" +args = ["man","--help"] +stdout = """ +rustup-man +View the man page for a given command + +USAGE: + rustup man [OPTIONS] + +FLAGS: + -h, --help Prints help information + +OPTIONS: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` + +ARGS: + +""" +stderr = "" diff --git a/tests/cli-ui/rustup_override_cmd_add_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_override_cmd_add_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..8191eef781 --- /dev/null +++ b/tests/cli-ui/rustup_override_cmd_add_cmd_help_flag_stdout.toml @@ -0,0 +1,20 @@ +bin.name = "rustup" +args = ["override","add","--help"] +stdout = """ +rustup-override-set +Set the override toolchain for a directory + +USAGE: + rustup override set [OPTIONS] + +FLAGS: + -h, --help Prints help information + +OPTIONS: + --path Path to the directory + +ARGS: + Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see `rustup help + toolchain` +""" +stderr = "" diff --git a/tests/cli-ui/rustup_override_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_override_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..2633189947 --- /dev/null +++ b/tests/cli-ui/rustup_override_cmd_help_flag_stdout.toml @@ -0,0 +1,40 @@ +bin.name = "rustup" +args = ["override","--help"] +stdout = """ +rustup-override +Modify directory toolchain overrides + +USAGE: + rustup override + +FLAGS: + -h, --help Prints help information + +SUBCOMMANDS: + list List directory toolchain overrides + set Set the override toolchain for a directory + unset Remove the override toolchain for a directory + help Prints this message or the help of the given subcommand(s) + +DISCUSSION: + Overrides configure Rustup to use a specific toolchain when + running in a specific directory. + + Directories can be assigned their own Rust toolchain with `rustup + override`. When a directory has an override then any time `rustc` + or `cargo` is run inside that directory, or one of its child + directories, the override toolchain will be invoked. + + To pin to a specific nightly: + + $ rustup override set nightly-2014-12-18 + + Or a specific stable release: + + $ rustup override set 1.0.0 + + To see the active toolchain use `rustup show`. To remove the + override and use the default toolchain again, `rustup override + unset`. +""" +stderr = "" diff --git a/tests/cli-ui/rustup_override_cmd_list_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_override_cmd_list_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..9c0f6767c9 --- /dev/null +++ b/tests/cli-ui/rustup_override_cmd_list_cmd_help_flag_stdout.toml @@ -0,0 +1,13 @@ +bin.name = "rustup" +args = ["override","list","--help"] +stdout = """ +rustup-override-list +List directory toolchain overrides + +USAGE: + rustup override list + +FLAGS: + -h, --help Prints help information +""" +stderr = "" diff --git a/tests/cli-ui/rustup_override_cmd_remove_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_override_cmd_remove_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..8e9c516b6a --- /dev/null +++ b/tests/cli-ui/rustup_override_cmd_remove_cmd_help_flag_stdout.toml @@ -0,0 +1,24 @@ +bin.name = "rustup" +args = ["override","unset","--help"] +stdout = """ +rustup-override-unset +Remove the override toolchain for a directory + +USAGE: + rustup override unset [FLAGS] [OPTIONS] + +FLAGS: + -h, --help Prints help information + --nonexistent Remove override toolchain for all nonexistent directories + +OPTIONS: + --path Path to the directory + +DISCUSSION: + If `--path` argument is present, removes the override toolchain + for the specified directory. If `--nonexistent` argument is + present, removes the override toolchain for all nonexistent + directories. Otherwise, removes the override toolchain for the + current directory. +""" +stderr = "" diff --git a/tests/cli-ui/rustup_override_cmd_set_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_override_cmd_set_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..dd2b5c873f --- /dev/null +++ b/tests/cli-ui/rustup_override_cmd_set_cmd_help_flag_stdout.toml @@ -0,0 +1,20 @@ +bin.name = "rustup" +args = ["override","set","--help"] +stdout = """ +rustup-override-set +Set the override toolchain for a directory + +USAGE: + rustup override set [OPTIONS] + +FLAGS: + -h, --help Prints help information + +OPTIONS: + --path Path to the directory + +ARGS: + Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see `rustup help + toolchain` +""" +stderr = "" diff --git a/tests/cli-ui/rustup_override_cmd_unset_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_override_cmd_unset_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..8e9c516b6a --- /dev/null +++ b/tests/cli-ui/rustup_override_cmd_unset_cmd_help_flag_stdout.toml @@ -0,0 +1,24 @@ +bin.name = "rustup" +args = ["override","unset","--help"] +stdout = """ +rustup-override-unset +Remove the override toolchain for a directory + +USAGE: + rustup override unset [FLAGS] [OPTIONS] + +FLAGS: + -h, --help Prints help information + --nonexistent Remove override toolchain for all nonexistent directories + +OPTIONS: + --path Path to the directory + +DISCUSSION: + If `--path` argument is present, removes the override toolchain + for the specified directory. If `--nonexistent` argument is + present, removes the override toolchain for all nonexistent + directories. Otherwise, removes the override toolchain for the + current directory. +""" +stderr = "" diff --git a/tests/cli-ui/rustup_run_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_run_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..0c3a6e28a0 --- /dev/null +++ b/tests/cli-ui/rustup_run_cmd_help_flag_stdout.toml @@ -0,0 +1,34 @@ +bin.name = "rustup" +args = ["run","--help"] +stdout = """ +rustup-run +Run a command with an environment configured for a given toolchain + +USAGE: + rustup run [FLAGS] ... + +FLAGS: + -h, --help Prints help information + --install Install the requested toolchain if needed + +ARGS: + Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see `rustup help + toolchain` + ... + +DISCUSSION: + Configures an environment to use the given toolchain and then runs + the specified program. The command may be any program, not just + rustc or cargo. This can be used for testing arbitrary toolchains + without setting an override. + + Commands explicitly proxied by `rustup` (such as `rustc` and + `cargo`) also have a shorthand for this available. The toolchain + can be set by using `+toolchain` as the first argument. These are + equivalent: + + $ cargo +nightly build + + $ rustup run nightly cargo build +""" +stderr = "" diff --git a/tests/cli-ui/rustup_self_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_self_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..03d1571b35 --- /dev/null +++ b/tests/cli-ui/rustup_self_cmd_help_flag_stdout.toml @@ -0,0 +1,19 @@ +bin.name = "rustup" +args = ["self","--help"] +stdout = """ +rustup-self +Modify the rustup installation + +USAGE: + rustup self + +FLAGS: + -h, --help Prints help information + +SUBCOMMANDS: + update Download and install updates to rustup + uninstall Uninstall rustup. + upgrade-data Upgrade the internal data format. + help Prints this message or the help of the given subcommand(s) +""" +stderr = "" diff --git a/tests/cli-ui/rustup_self_cmd_uninstall_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_self_cmd_uninstall_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..8739c9903c --- /dev/null +++ b/tests/cli-ui/rustup_self_cmd_uninstall_cmd_help_flag_stdout.toml @@ -0,0 +1,14 @@ +bin.name = "rustup" +args = ["self","uninstall","--help"] +stdout = """ +rustup-self-uninstall +Uninstall rustup. + +USAGE: + rustup self uninstall [FLAGS] + +FLAGS: + -h, --help Prints help information + -y +""" +stderr = "" diff --git a/tests/cli-ui/rustup_self_cmd_update_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_self_cmd_update_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..f371485885 --- /dev/null +++ b/tests/cli-ui/rustup_self_cmd_update_cmd_help_flag_stdout.toml @@ -0,0 +1,13 @@ +bin.name = "rustup" +args = ["self","update","--help"] +stdout = """ +rustup-self-update +Download and install updates to rustup + +USAGE: + rustup self update + +FLAGS: + -h, --help Prints help information +""" +stderr = "" diff --git a/tests/cli-ui/rustup_self_cmd_upgrade-data _cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_self_cmd_upgrade-data _cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..9219a08223 --- /dev/null +++ b/tests/cli-ui/rustup_self_cmd_upgrade-data _cmd_help_flag_stdout.toml @@ -0,0 +1,13 @@ +bin.name = "rustup" +args = ["self","upgrade-data","--help"] +stdout = """ +rustup-self-upgrade-data +Upgrade the internal data format. + +USAGE: + rustup self upgrade-data + +FLAGS: + -h, --help Prints help information +""" +stderr = "" diff --git a/tests/cli-ui/rustup_set_cmd_auto-self-update_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_set_cmd_auto-self-update_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..fc1143fd21 --- /dev/null +++ b/tests/cli-ui/rustup_set_cmd_auto-self-update_cmd_help_flag_stdout.toml @@ -0,0 +1,17 @@ +bin.name = "rustup" +args = ["set","auto-self-update","--help"] +stdout = """ +rustup-set-auto-self-update +The rustup auto self update mode + +USAGE: + rustup set auto-self-update + +FLAGS: + -h, --help Prints help information + -V, --version Prints version information + +ARGS: + [default: enable] [possible values: enable, disable, check-only] +""" +stderr = "" diff --git a/tests/cli-ui/rustup_set_cmd_default-host_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_set_cmd_default-host_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..fbca29dea9 --- /dev/null +++ b/tests/cli-ui/rustup_set_cmd_default-host_cmd_help_flag_stdout.toml @@ -0,0 +1,17 @@ +bin.name = "rustup" +args = ["set","default-host","--help"] +stdout = """ +rustup-set-default-host +The triple used to identify toolchains when not specified + +USAGE: + rustup set default-host + +FLAGS: + -h, --help Prints help information + -V, --version Prints version information + +ARGS: + +""" +stderr = "" diff --git a/tests/cli-ui/rustup_set_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_set_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..41d8bf0a46 --- /dev/null +++ b/tests/cli-ui/rustup_set_cmd_help_flag_stdout.toml @@ -0,0 +1,19 @@ +bin.name = "rustup" +args = ["set","--help"] +stdout = """ +rustup-set +Alter rustup settings + +USAGE: + rustup set + +FLAGS: + -h, --help Prints help information + +SUBCOMMANDS: + auto-self-update The rustup auto self update mode + default-host The triple used to identify toolchains when not specified + help Prints this message or the help of the given subcommand(s) + profile The default components installed +""" +stderr = "" diff --git a/tests/cli-ui/rustup_set_cmd_profile_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_set_cmd_profile_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..205cbedc6d --- /dev/null +++ b/tests/cli-ui/rustup_set_cmd_profile_cmd_help_flag_stdout.toml @@ -0,0 +1,17 @@ +bin.name = "rustup" +args = ["set","profile","--help"] +stdout = """ +rustup-set-profile +The default components installed + +USAGE: + rustup set profile + +FLAGS: + -h, --help Prints help information + -V, --version Prints version information + +ARGS: + [default: default] [possible values: minimal, default, complete] +""" +stderr = "" diff --git a/tests/cli-ui/rustup_show_cmd_active-toolchain_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_show_cmd_active-toolchain_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..926d2b566b --- /dev/null +++ b/tests/cli-ui/rustup_show_cmd_active-toolchain_cmd_help_flag_stdout.toml @@ -0,0 +1,23 @@ +bin.name = "rustup" +args = ["show","active-toolchain","--help"] +stdout = """ +rustup-show-active-toolchain +Show the active toolchain + +USAGE: + rustup show active-toolchain [FLAGS] + +FLAGS: + -h, --help Prints help information + -v, --verbose Enable verbose output with rustc information + +DISCUSSION: + Shows the name of the active toolchain. + + This is useful for figuring out the active tool chain from + scripts. + + You should use `rustc --print sysroot` to get the sysroot, or + `rustc --version` to get the toolchain version. +""" +stderr = "" diff --git a/tests/cli-ui/rustup_show_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_show_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..1755e29db0 --- /dev/null +++ b/tests/cli-ui/rustup_show_cmd_help_flag_stdout.toml @@ -0,0 +1,30 @@ +bin.name = "rustup" +args = ["show","--help"] +stdout = """ +rustup-show +Show the active and installed toolchains or profiles + +USAGE: + rustup show [FLAGS] [SUBCOMMAND] + +FLAGS: + -v, --verbose Enable verbose output with rustc information for all installed toolchains + -h, --help Prints help information + +SUBCOMMANDS: + active-toolchain Show the active toolchain + home Display the computed value of RUSTUP_HOME + profile Show the current profile + keys Display the known PGP keys + help Prints this message or the help of the given subcommand(s) + +DISCUSSION: + Shows the name of the active toolchain and the version of `rustc`. + + If the active toolchain has installed support for additional + compilation targets, then they are listed as well. + + If there are multiple toolchains installed then all installed + toolchains are listed as well. +""" +stderr = "" diff --git a/tests/cli-ui/rustup_show_cmd_home_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_show_cmd_home_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..4eb2468b7a --- /dev/null +++ b/tests/cli-ui/rustup_show_cmd_home_cmd_help_flag_stdout.toml @@ -0,0 +1,13 @@ +bin.name = "rustup" +args = ["show","home","--help"] +stdout = """ +rustup-show-home +Display the computed value of RUSTUP_HOME + +USAGE: + rustup show home + +FLAGS: + -h, --help Prints help information +""" +stderr = "" diff --git a/tests/cli-ui/rustup_show_cmd_keys_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_show_cmd_keys_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..b6fcee16fd --- /dev/null +++ b/tests/cli-ui/rustup_show_cmd_keys_cmd_help_flag_stdout.toml @@ -0,0 +1,13 @@ +bin.name = "rustup" +args = ["show","keys","--help"] +stdout = """ +rustup-show-keys +Display the known PGP keys + +USAGE: + rustup show keys + +FLAGS: + -h, --help Prints help information +""" +stderr = "" diff --git a/tests/cli-ui/rustup_show_cmd_profile_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_show_cmd_profile_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..606337a4f5 --- /dev/null +++ b/tests/cli-ui/rustup_show_cmd_profile_cmd_help_flag_stdout.toml @@ -0,0 +1,13 @@ +bin.name = "rustup" +args = ["show","profile","--help"] +stdout = """ +rustup-show-profile +Show the current profile + +USAGE: + rustup show profile + +FLAGS: + -h, --help Prints help information +""" +stderr = "" diff --git a/tests/cli-ui/rustup_target_cmd_add_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_target_cmd_add_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..9b42dd12b5 --- /dev/null +++ b/tests/cli-ui/rustup_target_cmd_add_cmd_help_flag_stdout.toml @@ -0,0 +1,20 @@ +bin.name = "rustup" +args = ["target","add","--help"] +stdout = """ +rustup-target-add +Add a target to a Rust toolchain + +USAGE: + rustup target add [OPTIONS] ... + +FLAGS: + -h, --help Prints help information + +OPTIONS: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` + +ARGS: + ... List of targets to install; \"all\" installs all available targets +""" +stderr = "" diff --git a/tests/cli-ui/rustup_target_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_target_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..2c36291409 --- /dev/null +++ b/tests/cli-ui/rustup_target_cmd_help_flag_stdout.toml @@ -0,0 +1,19 @@ +bin.name = "rustup" +args = ["target","--help"] +stdout = """ +rustup-target +Modify a toolchain's supported targets + +USAGE: + rustup target + +FLAGS: + -h, --help Prints help information + +SUBCOMMANDS: + list List installed and available targets + add Add a target to a Rust toolchain + remove Remove a target from a Rust toolchain + help Prints this message or the help of the given subcommand(s) +""" +stderr = "" diff --git a/tests/cli-ui/rustup_target_cmd_list_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_target_cmd_list_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..d40524b0f0 --- /dev/null +++ b/tests/cli-ui/rustup_target_cmd_list_cmd_help_flag_stdout.toml @@ -0,0 +1,18 @@ +bin.name = "rustup" +args = ["target","list","--help"] +stdout = """ +rustup-target-list +List installed and available targets + +USAGE: + rustup target list [FLAGS] [OPTIONS] + +FLAGS: + -h, --help Prints help information + --installed List only installed targets + +OPTIONS: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` +""" +stderr = "" diff --git a/tests/cli-ui/rustup_target_cmd_remove_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_target_cmd_remove_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..41c9205bf3 --- /dev/null +++ b/tests/cli-ui/rustup_target_cmd_remove_cmd_help_flag_stdout.toml @@ -0,0 +1,20 @@ +bin.name = "rustup" +args = ["target","remove","--help"] +stdout = """ +rustup-target-remove +Remove a target from a Rust toolchain + +USAGE: + rustup target remove [OPTIONS] ... + +FLAGS: + -h, --help Prints help information + +OPTIONS: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` + +ARGS: + ... +""" +stderr = "" diff --git a/tests/cli-ui/rustup_toolchain_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_toolchain_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..576bb24e3e --- /dev/null +++ b/tests/cli-ui/rustup_toolchain_cmd_help_flag_stdout.toml @@ -0,0 +1,62 @@ +bin.name = "rustup" +args = ["toolchain","--help"] +stdout = """ +rustup-toolchain +Modify or query the installed toolchains + +USAGE: + rustup toolchain + +FLAGS: + -h, --help Prints help information + +SUBCOMMANDS: + list List installed toolchains + install Install or update a given toolchain + uninstall Uninstall a toolchain + link Create a custom toolchain by symlinking to a directory + help Prints this message or the help of the given subcommand(s) + +DISCUSSION: + Many `rustup` commands deal with *toolchains*, a single + installation of the Rust compiler. `rustup` supports multiple + types of toolchains. The most basic track the official release + channels: 'stable', 'beta' and 'nightly'; but `rustup` can also + install toolchains from the official archives, for alternate host + platforms, and from local builds. + + Standard release channel toolchain names have the following form: + + [-][-] + + = stable|beta|nightly|| + = YYYY-MM-DD + = + + 'channel' is a named release channel, a major and minor version + number such as `1.42`, or a fully specified version number, such + as `1.42.0`. Channel names can be optionally appended with an + archive date, as in `nightly-2014-12-18`, in which case the + toolchain is downloaded from the archive for that date. + + The host may be specified as a target triple. This is most useful + for installing a 32-bit compiler on a 64-bit platform, or for + installing the [MSVC-based toolchain] on Windows. For example: + + $ rustup toolchain install stable-x86_64-pc-windows-msvc + + For convenience, omitted elements of the target triple will be + inferred, so the above could be written: + + $ rustup toolchain install stable-msvc + + The `rustup default` command may be used to both install and set + the desired toolchain as default in a single command: + + $ rustup default stable-msvc + + rustup can also manage symlinked local toolchain builds, which are + often used for developing Rust itself. For more information see + `rustup toolchain help link`. +""" +stderr = "" diff --git a/tests/cli-ui/rustup_toolchain_cmd_install_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_toolchain_cmd_install_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..30e3fdcbd4 --- /dev/null +++ b/tests/cli-ui/rustup_toolchain_cmd_install_cmd_help_flag_stdout.toml @@ -0,0 +1,27 @@ +bin.name = "rustup" +args = ["toolchain","install","--help"] +stdout = """ +rustup-toolchain-install +Install or update a given toolchain + +USAGE: + rustup toolchain install [FLAGS] [OPTIONS] ... + +FLAGS: + --allow-downgrade Allow rustup to downgrade the toolchain to satisfy your component choice + --force Force an update, even if some components are missing + --force-non-host Install toolchains that require an emulator. See https://github.com/rust- + lang/rustup/wiki/Non-host-toolchains + -h, --help Prints help information + --no-self-update Don't perform self update when running the`rustup toolchain install` command + +OPTIONS: + -c, --component ... Add specific components on installation + --profile [possible values: minimal, default, complete] + -t, --target ... Add specific targets on installation + +ARGS: + ... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see `rustup help + toolchain` +""" +stderr = "" diff --git a/tests/cli-ui/rustup_toolchain_cmd_link_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_toolchain_cmd_link_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..2350d2cc24 --- /dev/null +++ b/tests/cli-ui/rustup_toolchain_cmd_link_cmd_help_flag_stdout.toml @@ -0,0 +1,36 @@ +bin.name = "rustup" +args = ["toolchain","link","--help"] +stdout = """ +rustup-toolchain-link +Create a custom toolchain by symlinking to a directory + +USAGE: + rustup toolchain link + +FLAGS: + -h, --help Prints help information + +ARGS: + Custom toolchain name + Path to the directory + +DISCUSSION: + 'toolchain' is the custom name to be assigned to the new toolchain. + Any name is permitted as long as it does not fully match an initial + substring of a standard release channel. For example, you can use + the names 'latest' or '2017-04-01' but you cannot use 'stable' or + 'beta-i686' or 'nightly-x86_64-unknown-linux-gnu'. + + 'path' specifies the directory where the binaries and libraries for + the custom toolchain can be found. For example, when used for + development of Rust itself, toolchains can be linked directly out of + the build directory. After building, you can test out different + compiler versions as follows: + + $ rustup toolchain link latest-stage1 build/x86_64-unknown-linux-gnu/stage1 + $ rustup override set latest-stage1 + + If you now compile a crate in the current directory, the custom + toolchain 'latest-stage1' will be used. +""" +stderr = "" diff --git a/tests/cli-ui/rustup_toolchain_cmd_list_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_toolchain_cmd_list_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..f95e43defd --- /dev/null +++ b/tests/cli-ui/rustup_toolchain_cmd_list_cmd_help_flag_stdout.toml @@ -0,0 +1,14 @@ +bin.name = "rustup" +args = ["toolchain","list","--help"] +stdout = """ +rustup-toolchain-list +List installed toolchains + +USAGE: + rustup toolchain list [FLAGS] + +FLAGS: + -h, --help Prints help information + -v, --verbose Enable verbose output with toolchain information +""" +stderr = "" diff --git a/tests/cli-ui/rustup_toolchain_cmd_uninstall_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_toolchain_cmd_uninstall_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..b1a2bc8b0d --- /dev/null +++ b/tests/cli-ui/rustup_toolchain_cmd_uninstall_cmd_help_flag_stdout.toml @@ -0,0 +1,17 @@ +bin.name = "rustup" +args = ["toolchain","uninstall","--help"] +stdout = """ +rustup-toolchain-uninstall +Uninstall a toolchain + +USAGE: + rustup toolchain uninstall ... + +FLAGS: + -h, --help Prints help information + +ARGS: + ... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see `rustup help + toolchain` +""" +stderr = "" diff --git a/tests/cli-ui/rustup_update_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_update_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..64c38fcb2d --- /dev/null +++ b/tests/cli-ui/rustup_update_cmd_help_flag_stdout.toml @@ -0,0 +1,29 @@ +bin.name = "rustup" +args = ["update","--help"] +stdout = """ +rustup-update +Update Rust toolchains and rustup + +USAGE: + rustup update [FLAGS] [toolchain]... + +FLAGS: + --force Force an update, even if some components are missing + --force-non-host Install toolchains that require an emulator. See https://github.com/rust- + lang/rustup/wiki/Non-host-toolchains + -h, --help Prints help information + --no-self-update Don't perform self update when running the `rustup update` command + +ARGS: + ... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see `rustup help + toolchain` + +DISCUSSION: + With no toolchain specified, the `update` command updates each of + the installed toolchains from the official release channels, then + updates rustup itself. + + If given a toolchain argument then `update` updates that + toolchain, the same as `rustup toolchain install`. +""" +stderr = "" diff --git a/tests/cli-ui/rustup_which_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_which_cmd_help_flag_stdout.toml new file mode 100644 index 0000000000..ed7fa8a506 --- /dev/null +++ b/tests/cli-ui/rustup_which_cmd_help_flag_stdout.toml @@ -0,0 +1,20 @@ +bin.name = "rustup" +args = ["which","--help"] +stdout = """ +rustup-which +Display which binary will be run for a given command + +USAGE: + rustup which [OPTIONS] + +FLAGS: + -h, --help Prints help information + +OPTIONS: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` + +ARGS: + +""" +stderr = "" From 0facdf6ff99b43efbc814cf075f3e525da680ead Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Sat, 11 Feb 2023 22:32:26 +0800 Subject: [PATCH 5/5] Fix windows tests Signed-off-by: hi-rustin --- tests/cli-ui.rs | 5 +++++ tests/cli-ui/rustup-init_help_flag_stdout.toml | 2 +- tests/cli-ui/rustup_check_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_completions_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_component_cmd_add_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_component_cmd_list_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_component_cmd_remove_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_default_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_doc_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_help_cmd_stdout.toml | 4 ++-- tests/cli-ui/rustup_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_man_cmd_help_flag_stdout.toml | 4 ++-- .../cli-ui/rustup_override_cmd_add_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_override_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_override_cmd_list_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_override_cmd_remove_cmd_help_flag_stdout.toml | 4 ++-- .../cli-ui/rustup_override_cmd_set_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_override_cmd_unset_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_run_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_self_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_self_cmd_uninstall_cmd_help_flag_stdout.toml | 4 ++-- .../cli-ui/rustup_self_cmd_update_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_self_cmd_upgrade-data _cmd_help_flag_stdout.toml | 4 ++-- ...rustup_set_cmd_auto-self-update_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_set_cmd_default-host_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_set_cmd_help_flag_stdout.toml | 4 ++-- .../cli-ui/rustup_set_cmd_profile_cmd_help_flag_stdout.toml | 4 ++-- ...ustup_show_cmd_active-toolchain_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_show_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_show_cmd_home_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_show_cmd_keys_cmd_help_flag_stdout.toml | 4 ++-- .../cli-ui/rustup_show_cmd_profile_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_target_cmd_add_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_target_cmd_help_flag_stdout.toml | 4 ++-- .../cli-ui/rustup_target_cmd_list_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_target_cmd_remove_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_toolchain_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_toolchain_cmd_install_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_toolchain_cmd_link_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_toolchain_cmd_list_cmd_help_flag_stdout.toml | 4 ++-- .../rustup_toolchain_cmd_uninstall_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_update_cmd_help_flag_stdout.toml | 4 ++-- tests/cli-ui/rustup_which_cmd_help_flag_stdout.toml | 4 ++-- 43 files changed, 88 insertions(+), 83 deletions(-) diff --git a/tests/cli-ui.rs b/tests/cli-ui.rs index e5e59cef28..2db6c4b999 100644 --- a/tests/cli-ui.rs +++ b/tests/cli-ui.rs @@ -10,4 +10,9 @@ fn ui_tests() { fs::copy(&rustup_init, &rustup).unwrap(); t.register_bin("rustup", &rustup); t.case("tests/cli-ui/*.toml"); + #[cfg(target_os = "windows")] + { + // On windows, we don't have man command, so skip the tests. + t.skip("tests/cli-ui/rustup_man_cmd_help_flag_stdout.toml"); + } } diff --git a/tests/cli-ui/rustup-init_help_flag_stdout.toml b/tests/cli-ui/rustup-init_help_flag_stdout.toml index d1c400eace..a067550d5a 100644 --- a/tests/cli-ui/rustup-init_help_flag_stdout.toml +++ b/tests/cli-ui/rustup-init_help_flag_stdout.toml @@ -6,7 +6,7 @@ rustup-init [..] The installer for rustup USAGE: - rustup-init [FLAGS] [OPTIONS] + rustup-init[EXE] [FLAGS] [OPTIONS] FLAGS: -v, --verbose Enable verbose output diff --git a/tests/cli-ui/rustup_check_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_check_cmd_help_flag_stdout.toml index aed5975c46..3e707294c6 100644 --- a/tests/cli-ui/rustup_check_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_check_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["check","--help"] stdout = """ -rustup-check +... Check for updates to Rust toolchains and rustup USAGE: - rustup check + rustup[EXE] check FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_completions_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_completions_cmd_help_flag_stdout.toml index a1132cedf2..0389eea1fd 100644 --- a/tests/cli-ui/rustup_completions_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_completions_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["completions","--help"] stdout = """ -rustup-completions +... Generate tab-completion scripts for your shell USAGE: - rustup completions [ARGS] + rustup[EXE] completions [ARGS] FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_component_cmd_add_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_component_cmd_add_cmd_help_flag_stdout.toml index 1412528393..8d3af97ad6 100644 --- a/tests/cli-ui/rustup_component_cmd_add_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_component_cmd_add_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["component","add","--help"] stdout = """ -rustup-component-add +... Add a component to a Rust toolchain USAGE: - rustup component add [OPTIONS] ... + rustup[EXE] component add [OPTIONS] ... FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_component_cmd_list_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_component_cmd_list_cmd_help_flag_stdout.toml index 82bd149449..b4c64893fe 100644 --- a/tests/cli-ui/rustup_component_cmd_list_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_component_cmd_list_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["component","list","--help"] stdout = """ -rustup-component-list +... List installed and available components USAGE: - rustup component list [FLAGS] [OPTIONS] + rustup[EXE] component list [FLAGS] [OPTIONS] FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_component_cmd_remove_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_component_cmd_remove_cmd_help_flag_stdout.toml index 4419ec694e..eafe8eb470 100644 --- a/tests/cli-ui/rustup_component_cmd_remove_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_component_cmd_remove_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["component","remove","--help"] stdout = """ -rustup-component-remove +... Remove a component from a Rust toolchain USAGE: - rustup component remove [OPTIONS] ... + rustup[EXE] component remove [OPTIONS] ... FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_default_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_default_cmd_help_flag_stdout.toml index b9c3c488a8..86e86a477a 100644 --- a/tests/cli-ui/rustup_default_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_default_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["default","--help"] stdout = """ -rustup-default +... Set the default toolchain USAGE: - rustup default [toolchain] + rustup[EXE] default [toolchain] FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_doc_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_doc_cmd_help_flag_stdout.toml index 0db427e6e5..90e88d4d5e 100644 --- a/tests/cli-ui/rustup_doc_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_doc_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["doc","--help"] stdout = """ -rustup-doc +... Open the documentation for the current toolchain USAGE: - rustup doc [FLAGS] [OPTIONS] [topic] + rustup[EXE] doc [FLAGS] [OPTIONS] [topic] FLAGS: --alloc The Rust core allocation and collections library diff --git a/tests/cli-ui/rustup_help_cmd_stdout.toml b/tests/cli-ui/rustup_help_cmd_stdout.toml index b5d761f974..2d37691dd6 100644 --- a/tests/cli-ui/rustup_help_cmd_stdout.toml +++ b/tests/cli-ui/rustup_help_cmd_stdout.toml @@ -6,7 +6,7 @@ rustup [..] The Rust toolchain installer USAGE: - rustup [FLAGS] [+toolchain] + rustup[EXE] [FLAGS] [+toolchain] FLAGS: -v, --verbose Enable verbose output @@ -29,7 +29,7 @@ SUBCOMMANDS: run Run a command with an environment configured for a given toolchain which Display which binary will be run for a given command doc Open the documentation for the current toolchain - man View the man page for a given command +... self Modify the rustup installation set Alter rustup settings completions Generate tab-completion scripts for your shell diff --git a/tests/cli-ui/rustup_help_flag_stdout.toml b/tests/cli-ui/rustup_help_flag_stdout.toml index 2315668b39..3a53e3ea37 100644 --- a/tests/cli-ui/rustup_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_help_flag_stdout.toml @@ -6,7 +6,7 @@ rustup [..] The Rust toolchain installer USAGE: - rustup [FLAGS] [+toolchain] + rustup[EXE] [FLAGS] [+toolchain] FLAGS: -v, --verbose Enable verbose output @@ -29,7 +29,7 @@ SUBCOMMANDS: run Run a command with an environment configured for a given toolchain which Display which binary will be run for a given command doc Open the documentation for the current toolchain - man View the man page for a given command +... self Modify the rustup installation set Alter rustup settings completions Generate tab-completion scripts for your shell diff --git a/tests/cli-ui/rustup_man_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_man_cmd_help_flag_stdout.toml index d9d3a2f8c6..8b40dcc950 100644 --- a/tests/cli-ui/rustup_man_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_man_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["man","--help"] stdout = """ -rustup-man +... View the man page for a given command USAGE: - rustup man [OPTIONS] + rustup[EXE] man [OPTIONS] FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_override_cmd_add_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_override_cmd_add_cmd_help_flag_stdout.toml index 8191eef781..9b60d6d6ce 100644 --- a/tests/cli-ui/rustup_override_cmd_add_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_override_cmd_add_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["override","add","--help"] stdout = """ -rustup-override-set +... Set the override toolchain for a directory USAGE: - rustup override set [OPTIONS] + rustup[EXE] override set [OPTIONS] FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_override_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_override_cmd_help_flag_stdout.toml index 2633189947..29611950c2 100644 --- a/tests/cli-ui/rustup_override_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_override_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["override","--help"] stdout = """ -rustup-override +... Modify directory toolchain overrides USAGE: - rustup override + rustup[EXE] override FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_override_cmd_list_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_override_cmd_list_cmd_help_flag_stdout.toml index 9c0f6767c9..e1c8952087 100644 --- a/tests/cli-ui/rustup_override_cmd_list_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_override_cmd_list_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["override","list","--help"] stdout = """ -rustup-override-list +... List directory toolchain overrides USAGE: - rustup override list + rustup[EXE] override list FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_override_cmd_remove_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_override_cmd_remove_cmd_help_flag_stdout.toml index 8e9c516b6a..0663165a39 100644 --- a/tests/cli-ui/rustup_override_cmd_remove_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_override_cmd_remove_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["override","unset","--help"] stdout = """ -rustup-override-unset +... Remove the override toolchain for a directory USAGE: - rustup override unset [FLAGS] [OPTIONS] + rustup[EXE] override unset [FLAGS] [OPTIONS] FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_override_cmd_set_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_override_cmd_set_cmd_help_flag_stdout.toml index dd2b5c873f..2447565140 100644 --- a/tests/cli-ui/rustup_override_cmd_set_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_override_cmd_set_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["override","set","--help"] stdout = """ -rustup-override-set +... Set the override toolchain for a directory USAGE: - rustup override set [OPTIONS] + rustup[EXE] override set [OPTIONS] FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_override_cmd_unset_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_override_cmd_unset_cmd_help_flag_stdout.toml index 8e9c516b6a..0663165a39 100644 --- a/tests/cli-ui/rustup_override_cmd_unset_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_override_cmd_unset_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["override","unset","--help"] stdout = """ -rustup-override-unset +... Remove the override toolchain for a directory USAGE: - rustup override unset [FLAGS] [OPTIONS] + rustup[EXE] override unset [FLAGS] [OPTIONS] FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_run_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_run_cmd_help_flag_stdout.toml index 0c3a6e28a0..0a0c902787 100644 --- a/tests/cli-ui/rustup_run_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_run_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["run","--help"] stdout = """ -rustup-run +... Run a command with an environment configured for a given toolchain USAGE: - rustup run [FLAGS] ... + rustup[EXE] run [FLAGS] ... FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_self_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_self_cmd_help_flag_stdout.toml index 03d1571b35..a60e056fa8 100644 --- a/tests/cli-ui/rustup_self_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_self_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["self","--help"] stdout = """ -rustup-self +... Modify the rustup installation USAGE: - rustup self + rustup[EXE] self FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_self_cmd_uninstall_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_self_cmd_uninstall_cmd_help_flag_stdout.toml index 8739c9903c..3f230e6496 100644 --- a/tests/cli-ui/rustup_self_cmd_uninstall_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_self_cmd_uninstall_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["self","uninstall","--help"] stdout = """ -rustup-self-uninstall +... Uninstall rustup. USAGE: - rustup self uninstall [FLAGS] + rustup[EXE] self uninstall [FLAGS] FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_self_cmd_update_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_self_cmd_update_cmd_help_flag_stdout.toml index f371485885..72cb5f837d 100644 --- a/tests/cli-ui/rustup_self_cmd_update_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_self_cmd_update_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["self","update","--help"] stdout = """ -rustup-self-update +... Download and install updates to rustup USAGE: - rustup self update + rustup[EXE] self update FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_self_cmd_upgrade-data _cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_self_cmd_upgrade-data _cmd_help_flag_stdout.toml index 9219a08223..9cf019ea92 100644 --- a/tests/cli-ui/rustup_self_cmd_upgrade-data _cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_self_cmd_upgrade-data _cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["self","upgrade-data","--help"] stdout = """ -rustup-self-upgrade-data +... Upgrade the internal data format. USAGE: - rustup self upgrade-data + rustup[EXE] self upgrade-data FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_set_cmd_auto-self-update_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_set_cmd_auto-self-update_cmd_help_flag_stdout.toml index fc1143fd21..622ab90522 100644 --- a/tests/cli-ui/rustup_set_cmd_auto-self-update_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_set_cmd_auto-self-update_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["set","auto-self-update","--help"] stdout = """ -rustup-set-auto-self-update +... The rustup auto self update mode USAGE: - rustup set auto-self-update + rustup[EXE] set auto-self-update FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_set_cmd_default-host_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_set_cmd_default-host_cmd_help_flag_stdout.toml index fbca29dea9..4df7a55911 100644 --- a/tests/cli-ui/rustup_set_cmd_default-host_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_set_cmd_default-host_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["set","default-host","--help"] stdout = """ -rustup-set-default-host +... The triple used to identify toolchains when not specified USAGE: - rustup set default-host + rustup[EXE] set default-host FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_set_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_set_cmd_help_flag_stdout.toml index 41d8bf0a46..2c92922e19 100644 --- a/tests/cli-ui/rustup_set_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_set_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["set","--help"] stdout = """ -rustup-set +... Alter rustup settings USAGE: - rustup set + rustup[EXE] set FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_set_cmd_profile_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_set_cmd_profile_cmd_help_flag_stdout.toml index 205cbedc6d..1a6db002d1 100644 --- a/tests/cli-ui/rustup_set_cmd_profile_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_set_cmd_profile_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["set","profile","--help"] stdout = """ -rustup-set-profile +... The default components installed USAGE: - rustup set profile + rustup[EXE] set profile FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_show_cmd_active-toolchain_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_show_cmd_active-toolchain_cmd_help_flag_stdout.toml index 926d2b566b..93aca775d2 100644 --- a/tests/cli-ui/rustup_show_cmd_active-toolchain_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_show_cmd_active-toolchain_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["show","active-toolchain","--help"] stdout = """ -rustup-show-active-toolchain +... Show the active toolchain USAGE: - rustup show active-toolchain [FLAGS] + rustup[EXE] show active-toolchain [FLAGS] FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_show_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_show_cmd_help_flag_stdout.toml index 1755e29db0..bb5425ca45 100644 --- a/tests/cli-ui/rustup_show_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_show_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["show","--help"] stdout = """ -rustup-show +... Show the active and installed toolchains or profiles USAGE: - rustup show [FLAGS] [SUBCOMMAND] + rustup[EXE] show [FLAGS] [SUBCOMMAND] FLAGS: -v, --verbose Enable verbose output with rustc information for all installed toolchains diff --git a/tests/cli-ui/rustup_show_cmd_home_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_show_cmd_home_cmd_help_flag_stdout.toml index 4eb2468b7a..130dd5b45a 100644 --- a/tests/cli-ui/rustup_show_cmd_home_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_show_cmd_home_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["show","home","--help"] stdout = """ -rustup-show-home +... Display the computed value of RUSTUP_HOME USAGE: - rustup show home + rustup[EXE] show home FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_show_cmd_keys_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_show_cmd_keys_cmd_help_flag_stdout.toml index b6fcee16fd..752b2bacee 100644 --- a/tests/cli-ui/rustup_show_cmd_keys_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_show_cmd_keys_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["show","keys","--help"] stdout = """ -rustup-show-keys +... Display the known PGP keys USAGE: - rustup show keys + rustup[EXE] show keys FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_show_cmd_profile_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_show_cmd_profile_cmd_help_flag_stdout.toml index 606337a4f5..1e6995f092 100644 --- a/tests/cli-ui/rustup_show_cmd_profile_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_show_cmd_profile_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["show","profile","--help"] stdout = """ -rustup-show-profile +... Show the current profile USAGE: - rustup show profile + rustup[EXE] show profile FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_target_cmd_add_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_target_cmd_add_cmd_help_flag_stdout.toml index 9b42dd12b5..5eb8a3b096 100644 --- a/tests/cli-ui/rustup_target_cmd_add_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_target_cmd_add_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["target","add","--help"] stdout = """ -rustup-target-add +... Add a target to a Rust toolchain USAGE: - rustup target add [OPTIONS] ... + rustup[EXE] target add [OPTIONS] ... FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_target_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_target_cmd_help_flag_stdout.toml index 2c36291409..a11997fdf9 100644 --- a/tests/cli-ui/rustup_target_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_target_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["target","--help"] stdout = """ -rustup-target +... Modify a toolchain's supported targets USAGE: - rustup target + rustup[EXE] target FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_target_cmd_list_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_target_cmd_list_cmd_help_flag_stdout.toml index d40524b0f0..ae6df3b036 100644 --- a/tests/cli-ui/rustup_target_cmd_list_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_target_cmd_list_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["target","list","--help"] stdout = """ -rustup-target-list +... List installed and available targets USAGE: - rustup target list [FLAGS] [OPTIONS] + rustup[EXE] target list [FLAGS] [OPTIONS] FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_target_cmd_remove_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_target_cmd_remove_cmd_help_flag_stdout.toml index 41c9205bf3..c66298321f 100644 --- a/tests/cli-ui/rustup_target_cmd_remove_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_target_cmd_remove_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["target","remove","--help"] stdout = """ -rustup-target-remove +... Remove a target from a Rust toolchain USAGE: - rustup target remove [OPTIONS] ... + rustup[EXE] target remove [OPTIONS] ... FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_toolchain_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_toolchain_cmd_help_flag_stdout.toml index 576bb24e3e..eed7045818 100644 --- a/tests/cli-ui/rustup_toolchain_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_toolchain_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["toolchain","--help"] stdout = """ -rustup-toolchain +... Modify or query the installed toolchains USAGE: - rustup toolchain + rustup[EXE] toolchain FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_toolchain_cmd_install_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_toolchain_cmd_install_cmd_help_flag_stdout.toml index 30e3fdcbd4..2e4253449f 100644 --- a/tests/cli-ui/rustup_toolchain_cmd_install_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_toolchain_cmd_install_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["toolchain","install","--help"] stdout = """ -rustup-toolchain-install +... Install or update a given toolchain USAGE: - rustup toolchain install [FLAGS] [OPTIONS] ... + rustup[EXE] toolchain install [FLAGS] [OPTIONS] ... FLAGS: --allow-downgrade Allow rustup to downgrade the toolchain to satisfy your component choice diff --git a/tests/cli-ui/rustup_toolchain_cmd_link_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_toolchain_cmd_link_cmd_help_flag_stdout.toml index 2350d2cc24..82e809fe4c 100644 --- a/tests/cli-ui/rustup_toolchain_cmd_link_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_toolchain_cmd_link_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["toolchain","link","--help"] stdout = """ -rustup-toolchain-link +... Create a custom toolchain by symlinking to a directory USAGE: - rustup toolchain link + rustup[EXE] toolchain link FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_toolchain_cmd_list_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_toolchain_cmd_list_cmd_help_flag_stdout.toml index f95e43defd..b40f471f0f 100644 --- a/tests/cli-ui/rustup_toolchain_cmd_list_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_toolchain_cmd_list_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["toolchain","list","--help"] stdout = """ -rustup-toolchain-list +... List installed toolchains USAGE: - rustup toolchain list [FLAGS] + rustup[EXE] toolchain list [FLAGS] FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_toolchain_cmd_uninstall_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_toolchain_cmd_uninstall_cmd_help_flag_stdout.toml index b1a2bc8b0d..b6c58490e2 100644 --- a/tests/cli-ui/rustup_toolchain_cmd_uninstall_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_toolchain_cmd_uninstall_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["toolchain","uninstall","--help"] stdout = """ -rustup-toolchain-uninstall +... Uninstall a toolchain USAGE: - rustup toolchain uninstall ... + rustup[EXE] toolchain uninstall ... FLAGS: -h, --help Prints help information diff --git a/tests/cli-ui/rustup_update_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_update_cmd_help_flag_stdout.toml index 64c38fcb2d..9d6c272728 100644 --- a/tests/cli-ui/rustup_update_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_update_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["update","--help"] stdout = """ -rustup-update +... Update Rust toolchains and rustup USAGE: - rustup update [FLAGS] [toolchain]... + rustup[EXE] update [FLAGS] [toolchain]... FLAGS: --force Force an update, even if some components are missing diff --git a/tests/cli-ui/rustup_which_cmd_help_flag_stdout.toml b/tests/cli-ui/rustup_which_cmd_help_flag_stdout.toml index ed7fa8a506..06d6fa75a8 100644 --- a/tests/cli-ui/rustup_which_cmd_help_flag_stdout.toml +++ b/tests/cli-ui/rustup_which_cmd_help_flag_stdout.toml @@ -1,11 +1,11 @@ bin.name = "rustup" args = ["which","--help"] stdout = """ -rustup-which +... Display which binary will be run for a given command USAGE: - rustup which [OPTIONS] + rustup[EXE] which [OPTIONS] FLAGS: -h, --help Prints help information