diff --git a/Cargo.lock b/Cargo.lock index 8b3aaf7751..778e6c1e35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -145,17 +145,6 @@ dependencies = [ "syn 2.0.15", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -302,37 +291,41 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.25" +version = "4.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" dependencies = [ - "atty", + "anstream", + "anstyle", "bitflags", "clap_lex", - "indexmap", "strsim", - "termcolor", "terminal_size", - "textwrap", ] [[package]] name = "clap_complete" -version = "3.2.5" +version = "4.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f7a2e0a962c45ce25afce14220bc24f9dade0a1787f185cecf96bfba7847cd8" +checksum = "501ff0a401473ea1d4c3b125ff95506b62c5bc5768d818634195fbb7c4ad5ff4" dependencies = [ "clap", ] [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] +checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" [[package]] name = "codespan-reporting" @@ -904,15 +897,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.2.6" @@ -1547,12 +1531,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "os_str_bytes" -version = "6.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" - [[package]] name = "overload" version = "0.1.1" @@ -2386,15 +2364,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" -dependencies = [ - "terminal_size", -] - [[package]] name = "thiserror" version = "1.0.40" diff --git a/Cargo.toml b/Cargo.toml index c19a19dd2f..051030fe5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,8 +46,8 @@ otel = [ anyhow.workspace = true cfg-if = "1.0" chrono = "0.4" -clap = { version = "3", features = ["wrap_help"] } -clap_complete = "3" +clap = { version = "4", features = ["wrap_help"] } +clap_complete = "4" download = { path = "download", default-features = false } effective-limits = "0.5.5" enum-map = "2.5.0" diff --git a/rustup-init.sh b/rustup-init.sh index ddc99f2472..dddf50cb65 100755 --- a/rustup-init.sh +++ b/rustup-init.sh @@ -25,48 +25,35 @@ RUSTUP_UPDATE_ROOT="${RUSTUP_UPDATE_ROOT:-https://static.rust-lang.org/rustup}" # NOTICE: If you change anything here, please make the same changes in setup_mode.rs usage() { cat < - Choose a default host triple - - --default-toolchain - Choose a default toolchain to install. Use 'none' to not install any toolchains at all - - --profile - [default: default] [possible values: minimal, default, complete] - - -c, --component ... - Component name to also install - - -t, --target ... - Target name to also install - - --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 - Print help information - - -V, --version - Print version information +Usage: rustup-init [OPTIONS] + +Options: + -v, --verbose + Enable verbose output + -q, --quiet + Disable progress output + -y + Disable confirmation prompt. + --default-host + Choose a default host triple + --default-toolchain + Choose a default toolchain to install. Use 'none' to not install any toolchains at all + --profile + [default: default] [possible values: minimal, default, complete] + -c, --component ... + Component name to also install + -t, --target ... + Target name to also install + --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 + Print help + -V, --version + Print version EOF } diff --git a/src/cli/help.rs b/src/cli/help.rs index 20e22bc879..9c352f08cc 100644 --- a/src/cli/help.rs +++ b/src/cli/help.rs @@ -1,4 +1,4 @@ -pub(crate) static RUSTUP_HELP: &str = r"DISCUSSION: +pub(crate) static RUSTUP_HELP: &str = r"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 @@ -8,7 +8,7 @@ pub(crate) static RUSTUP_HELP: &str = r"DISCUSSION: If you are new to Rust consider running `rustup doc --book` to learn Rust."; -pub(crate) static SHOW_HELP: &str = r"DISCUSSION: +pub(crate) static SHOW_HELP: &str = r"Discussion: Shows the name of the active toolchain and the version of `rustc`. If the active toolchain has installed support for additional @@ -17,7 +17,7 @@ pub(crate) static SHOW_HELP: &str = r"DISCUSSION: If there are multiple toolchains installed then all installed toolchains are listed as well."; -pub(crate) static SHOW_ACTIVE_TOOLCHAIN_HELP: &str = r"DISCUSSION: +pub(crate) static SHOW_ACTIVE_TOOLCHAIN_HELP: &str = r"Discussion: Shows the name of the active toolchain. This is useful for figuring out the active tool chain from @@ -26,7 +26,7 @@ pub(crate) static SHOW_ACTIVE_TOOLCHAIN_HELP: &str = r"DISCUSSION: You should use `rustc --print sysroot` to get the sysroot, or `rustc --version` to get the toolchain version."; -pub(crate) static UPDATE_HELP: &str = r"DISCUSSION: +pub(crate) static UPDATE_HELP: &str = r"Discussion: With no toolchain specified, the `update` command updates each of the installed toolchains from the official release channels, then updates rustup itself. @@ -34,16 +34,16 @@ pub(crate) static UPDATE_HELP: &str = r"DISCUSSION: If given a toolchain argument then `update` updates that toolchain, the same as `rustup toolchain install`."; -pub(crate) static INSTALL_HELP: &str = r"DISCUSSION: +pub(crate) static INSTALL_HELP: &str = r"Discussion: Installs a specific rust toolchain. The 'install' command is an alias for 'rustup update '."; -pub(crate) static DEFAULT_HELP: &str = r"DISCUSSION: +pub(crate) static DEFAULT_HELP: &str = r"Discussion: Sets the default toolchain to the one specified. If the toolchain is not already installed then it is installed first."; -pub(crate) static TOOLCHAIN_HELP: &str = r"DISCUSSION: +pub(crate) static TOOLCHAIN_HELP: &str = r"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 @@ -85,7 +85,7 @@ pub(crate) static TOOLCHAIN_HELP: &str = r"DISCUSSION: often used for developing Rust itself. For more information see `rustup toolchain help link`."; -pub(crate) static TOOLCHAIN_LINK_HELP: &str = r"DISCUSSION: +pub(crate) static TOOLCHAIN_LINK_HELP: &str = r"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 @@ -104,7 +104,7 @@ pub(crate) static TOOLCHAIN_LINK_HELP: &str = r"DISCUSSION: If you now compile a crate in the current directory, the custom toolchain 'latest-stage1' will be used."; -pub(crate) static OVERRIDE_HELP: &str = r"DISCUSSION: +pub(crate) static OVERRIDE_HELP: &str = r"Discussion: Overrides configure Rustup to use a specific toolchain when running in a specific directory. @@ -125,14 +125,14 @@ pub(crate) static OVERRIDE_HELP: &str = r"DISCUSSION: override and use the default toolchain again, `rustup override unset`."; -pub(crate) static OVERRIDE_UNSET_HELP: &str = r"DISCUSSION: +pub(crate) static OVERRIDE_UNSET_HELP: &str = r"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."; -pub(crate) static RUN_HELP: &str = r"DISCUSSION: +pub(crate) static RUN_HELP: &str = r"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 @@ -147,14 +147,14 @@ pub(crate) static RUN_HELP: &str = r"DISCUSSION: $ rustup run nightly cargo build"; -pub(crate) static DOC_HELP: &str = r"DISCUSSION: +pub(crate) static DOC_HELP: &str = r"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."; -pub(crate) static COMPLETIONS_HELP: &str = r"DISCUSSION: +pub(crate) static COMPLETIONS_HELP: &str = r"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 diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs index 8960d9de29..eda64e1bbd 100644 --- a/src/cli/rustup_mode.rs +++ b/src/cli/rustup_mode.rs @@ -6,8 +6,8 @@ use std::str::FromStr; use anyhow::{anyhow, bail, Error, Result}; use clap::{ - builder::{EnumValueParser, PossibleValuesParser}, - AppSettings, Arg, ArgAction, ArgEnum, ArgGroup, ArgMatches, Command, PossibleValue, + builder::{EnumValueParser, PossibleValue, PossibleValuesParser}, + Arg, ArgAction, ArgGroup, ArgMatches, Command, ValueEnum, }; use clap_complete::Shell; @@ -72,7 +72,7 @@ where pub fn main() -> Result { self_update::cleanup_self_updater()?; - use clap::ErrorKind::*; + use clap::error::ErrorKind::*; let matches = match cli().try_get_matches_from(process().args_os()) { Ok(matches) => Ok(matches), Err(err) if err.kind() == DisplayHelp => { @@ -230,13 +230,13 @@ pub fn main() -> Result { }) } -pub(crate) fn cli() -> Command<'static> { +pub(crate) fn cli() -> Command { let mut app = Command::new("rustup") .version(common::version()) .about("The Rust toolchain installer") .after_help(RUSTUP_HELP) - .global_setting(AppSettings::DeriveDisplayOrder) - .setting(AppSettings::SubcommandRequiredElseHelp) + .subcommand_required(true) + .arg_required_else_help(true) .arg( verbose_arg("Enable verbose output"), ) @@ -296,14 +296,13 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .required(true) - .takes_value(true) - .multiple_values(true) + .num_args(1..) ) .arg( Arg::new("profile") .long("profile") .value_parser(PossibleValuesParser::new(Profile::names())) - .takes_value(true), + .num_args(1), ) .arg( Arg::new("no-self-update") @@ -331,21 +330,19 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .required(true) - .takes_value(true) - .multiple_values(true), + .num_args(1..), ), ) .subcommand( Command::new("update") .about("Update Rust toolchains and rustup") - .aliases(&["upgrade", "up"]) + .aliases(["upgrade", "up"]) .after_help(UPDATE_HELP) .arg( Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .required(false) - .takes_value(true) - .multiple_values(true), + .num_args(1..), ) .arg( Arg::new("no-self-update") @@ -381,7 +378,7 @@ pub(crate) fn cli() -> Command<'static> { Command::new("toolchain") .about("Modify or query the installed toolchains") .after_help(TOOLCHAIN_HELP) - .setting(AppSettings::SubcommandRequiredElseHelp) + .subcommand_required(true) .subcommand( Command::new("list") .about("List installed toolchains") @@ -392,28 +389,26 @@ pub(crate) fn cli() -> Command<'static> { .subcommand( Command::new("install") .about("Install or update a given toolchain") - .aliases(&["update", "add"]) + .aliases(["update", "add"]) .arg( Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .required(true) - .takes_value(true) - .multiple_values(true), + .num_args(1..), ) .arg( Arg::new("profile") .long("profile") .value_parser(PossibleValuesParser::new(Profile::names())) - .takes_value(true), + .num_args(1), ) .arg( Arg::new("components") .help("Add specific components on installation") .long("component") .short('c') - .takes_value(true) - .multiple_values(true) - .use_value_delimiter(true) + .num_args(1..) + .value_delimiter(',') .action(ArgAction::Append), ) .arg( @@ -421,9 +416,8 @@ pub(crate) fn cli() -> Command<'static> { .help("Add specific targets on installation") .long("target") .short('t') - .takes_value(true) - .multiple_values(true) - .use_value_delimiter(true) + .num_args(1..) + .value_delimiter(',') .action(ArgAction::Append), ) .arg( @@ -433,7 +427,6 @@ pub(crate) fn cli() -> Command<'static> { `rustup toolchain install` command", ) .long("no-self-update") - .takes_value(true) .action(ArgAction::SetTrue) ) .arg( @@ -463,8 +456,7 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .required(true) - .takes_value(true) - .multiple_values(true), + .num_args(1..), ), ) .subcommand( @@ -486,7 +478,7 @@ pub(crate) fn cli() -> Command<'static> { .subcommand( Command::new("target") .about("Modify a toolchain's supported targets") - .setting(AppSettings::SubcommandRequiredElseHelp) + .subcommand_required(true) .subcommand( Command::new("list") .about("List installed and available targets") @@ -494,7 +486,7 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true), + .num_args(1), ) .arg( Arg::new("installed") @@ -510,8 +502,7 @@ pub(crate) fn cli() -> Command<'static> { .arg( Arg::new("target") .required(true) - .takes_value(true) - .multiple_values(true) + .num_args(1..) .help( "List of targets to install; \ \"all\" installs all available targets" @@ -521,7 +512,7 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true), + .num_args(1), ), ) .subcommand( @@ -532,21 +523,20 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("target") .help("List of targets to uninstall") .required(true) - .takes_value(true) - .multiple_values(true) + .num_args(1..) ) .arg( Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true), + .num_args(1), ), ), ) .subcommand( Command::new("component") .about("Modify a toolchain's installed components") - .setting(AppSettings::SubcommandRequiredElseHelp) + .subcommand_required(true) .subcommand( Command::new("list") .about("List installed and available components") @@ -554,7 +544,7 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true), + .num_args(1), ) .arg( Arg::new("installed") @@ -567,34 +557,34 @@ pub(crate) fn cli() -> Command<'static> { Command::new("add") .about("Add a component to a Rust toolchain") .arg(Arg::new("component").required(true) - .takes_value(true).multiple_values(true)) + .num_args(1..)) .arg( Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true), + .num_args(1), ) .arg( Arg::new("target") .long("target") - .takes_value(true) + .num_args(1) ), ) .subcommand( Command::new("remove") .about("Remove a component from a Rust toolchain") .arg(Arg::new("component").required(true) - .takes_value(true).multiple_values(true)) + .num_args(1..)) .arg( Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true), + .num_args(1), ) .arg( Arg::new("target") .long("target") - .takes_value(true) + .num_args(1) ), ), ) @@ -602,7 +592,7 @@ pub(crate) fn cli() -> Command<'static> { Command::new("override") .about("Modify directory toolchain overrides") .after_help(OVERRIDE_HELP) - .setting(AppSettings::SubcommandRequiredElseHelp) + .subcommand_required(true) .subcommand( Command::new("list").about("List directory toolchain overrides"), ) @@ -614,12 +604,12 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .required(true) - .takes_value(true), + .num_args(1), ) .arg( Arg::new("path") .long("path") - .takes_value(true) + .num_args(1) .help("Path to the directory"), ), ) @@ -631,7 +621,7 @@ pub(crate) fn cli() -> Command<'static> { .arg( Arg::new("path") .long("path") - .takes_value(true) + .num_args(1) .help("Path to the directory"), ) .arg( @@ -646,19 +636,18 @@ pub(crate) fn cli() -> Command<'static> { Command::new("run") .about("Run a command with an environment configured for a given toolchain") .after_help(RUN_HELP) - .trailing_var_arg(true) .arg( Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .required(true) - .takes_value(true), + .num_args(1), ) .arg( Arg::new("command") .required(true) - .takes_value(true) - .multiple_values(true) - .use_value_delimiter(false), + .num_args(1..) + .value_delimiter(None) + .trailing_var_arg(true), ) .arg( Arg::new("install") @@ -675,7 +664,7 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true), + .num_args(1), ), ) .subcommand( @@ -693,12 +682,12 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true), + .num_args(1), ) .arg(Arg::new("topic").help(TOPIC_ARG_HELP)) .group( ArgGroup::new("page").args( - &DOCS_DATA + DOCS_DATA .iter() .map(|(name, _, _)| *name) .collect::>(), @@ -721,7 +710,7 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true), + .num_args(1), ), ); } @@ -730,7 +719,7 @@ pub(crate) fn cli() -> Command<'static> { .subcommand( Command::new("self") .about("Modify the rustup installation") - .setting(AppSettings::SubcommandRequiredElseHelp) + .subcommand_required(true) .subcommand(Command::new("update").about("Download and install updates to rustup")) .subcommand( Command::new("uninstall") @@ -744,7 +733,7 @@ pub(crate) fn cli() -> Command<'static> { .subcommand( Command::new("set") .about("Alter rustup settings") - .setting(AppSettings::SubcommandRequiredElseHelp) + .subcommand_required(true) .subcommand( Command::new("default-host") .about("The triple used to identify toolchains when not specified") @@ -786,7 +775,7 @@ pub(crate) fn cli() -> Command<'static> { ) } -fn verbose_arg(help: &str) -> Arg<'_> { +fn verbose_arg(help: &'static str) -> Arg { Arg::new("verbose") .help(help) .short('v') @@ -1682,12 +1671,12 @@ pub(crate) enum CompletionCommand { Cargo, } -impl clap::ValueEnum for CompletionCommand { +impl ValueEnum for CompletionCommand { fn value_variants<'a>() -> &'a [Self] { &[Self::Rustup, Self::Cargo] } - fn to_possible_value<'a>(&self) -> Option> { + fn to_possible_value(&self) -> Option { Some(match self { CompletionCommand::Rustup => PossibleValue::new("rustup"), CompletionCommand::Cargo => PossibleValue::new("cargo"), diff --git a/src/cli/setup_mode.rs b/src/cli/setup_mode.rs index 4f8aec8cb6..cfbe85cf51 100644 --- a/src/cli/setup_mode.rs +++ b/src/cli/setup_mode.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use clap::{builder::PossibleValuesParser, AppSettings, Arg, ArgAction, Command}; +use clap::{builder::PossibleValuesParser, Arg, ArgAction, Command}; use super::common; use super::self_update::{self, InstallOpts}; @@ -27,7 +27,6 @@ pub fn main() -> Result { let cli = Command::new("rustup-init") .version(common::version()) .about("The installer for rustup") - .setting(AppSettings::DeriveDisplayOrder) .arg( Arg::new("verbose") .short('v') @@ -52,13 +51,13 @@ pub fn main() -> Result { .arg( Arg::new("default-host") .long("default-host") - .takes_value(true) + .num_args(1) .help("Choose a default host triple"), ) .arg( Arg::new("default-toolchain") .long("default-toolchain") - .takes_value(true) + .num_args(1) .help("Choose a default toolchain to install. Use 'none' to not install any toolchains at all"), ) .arg( @@ -72,9 +71,8 @@ pub fn main() -> Result { .help("Component name to also install") .long("component") .short('c') - .takes_value(true) - .multiple_values(true) - .use_value_delimiter(true) + .num_args(1..) + .value_delimiter(',') .action(ArgAction::Append), ) .arg( @@ -82,9 +80,8 @@ pub fn main() -> Result { .help("Target name to also install") .long("target") .short('t') - .takes_value(true) - .multiple_values(true) - .use_value_delimiter(true) + .num_args(1..) + .value_delimiter(',') .action(ArgAction::Append), ) .arg( @@ -103,8 +100,8 @@ pub fn main() -> Result { let matches = match cli.try_get_matches_from(process().args_os()) { Ok(matches) => matches, Err(e) - if e.kind() == clap::ErrorKind::DisplayHelp - || e.kind() == clap::ErrorKind::DisplayVersion => + if e.kind() == clap::error::ErrorKind::DisplayHelp + || e.kind() == clap::error::ErrorKind::DisplayVersion => { write!(process().stdout().lock(), "{e}")?; return Ok(utils::ExitCode(0)); diff --git a/src/test.rs b/src/test.rs index 6914a3ff7c..2812e5f541 100644 --- a/src/test.rs +++ b/src/test.rs @@ -121,7 +121,7 @@ pub fn this_host_triple() -> String { // For windows, this host may be different to the target: we may be // building with i686 toolchain, but on an x86_64 host, so run the // actual detection logic and trust it. - let tp = Box::new(currentprocess::TestProcess::default()); + let tp = Box::::default(); return currentprocess::with(tp, || TargetTriple::from_host().unwrap().to_string()); } let arch = if cfg!(target_arch = "x86") { diff --git a/tests/mock/clitools.rs b/tests/mock/clitools.rs index 64aa9dfaf9..af93d2f164 100644 --- a/tests/mock/clitools.rs +++ b/tests/mock/clitools.rs @@ -169,7 +169,7 @@ impl ConstState { Some(ref path) => Ok(path.clone()), None => { - let dist_path = self.const_dist_dir.path().join(format!("{:?}", s)); + let dist_path = self.const_dist_dir.path().join(format!("{s:?}")); create_mock_dist_server(&dist_path, s); *lock = Some(dist_path.clone()); Ok(dist_path) diff --git a/tests/suite/cli-ui/rustup-init/rustup-init_help_flag_stdout.toml b/tests/suite/cli-ui/rustup-init/rustup-init_help_flag_stdout.toml index 3aec80655d..a40c85eda7 100644 --- a/tests/suite/cli-ui/rustup-init/rustup-init_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup-init/rustup-init_help_flag_stdout.toml @@ -2,47 +2,34 @@ bin.name = "rustup-init" args = ["--help"] status.code = 0 stdout = """ -rustup-init [..] The installer for rustup -USAGE: - rustup-init[EXE] [OPTIONS] - -OPTIONS: - -v, --verbose - Enable verbose output - - -q, --quiet - Disable progress output - - -y - Disable confirmation prompt. - - --default-host - Choose a default host triple - - --default-toolchain - Choose a default toolchain to install. Use 'none' to not install any toolchains at all - - --profile - [default: default] [possible values: minimal, default, complete] - - -c, --component ... - Component name to also install - - -t, --target ... - Target name to also install - - --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 - Print help information - - -V, --version - Print version information +Usage: rustup-init[EXE] [OPTIONS] + +Options: + -v, --verbose + Enable verbose output + -q, --quiet + Disable progress output + -y + Disable confirmation prompt. + --default-host + Choose a default host triple + --default-toolchain + Choose a default toolchain to install. Use 'none' to not install any toolchains at all + --profile + [default: default] [possible values: minimal, default, complete] + -c, --component ... + Component name to also install + -t, --target ... + Target name to also install + --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 + Print help + -V, --version + Print version """ stderr = "" diff --git a/tests/suite/cli-ui/rustup-init/rustup-init_sh_help_flag_stdout.toml b/tests/suite/cli-ui/rustup-init/rustup-init_sh_help_flag_stdout.toml index 706f9ec3c6..571a728ad4 100644 --- a/tests/suite/cli-ui/rustup-init/rustup-init_sh_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup-init/rustup-init_sh_help_flag_stdout.toml @@ -2,47 +2,34 @@ bin.name = "rustup-init.sh" args = ["--help"] status.code = 0 stdout = """ -rustup-init [..] The installer for rustup -USAGE: - rustup-init[EXE] [OPTIONS] - -OPTIONS: - -v, --verbose - Enable verbose output - - -q, --quiet - Disable progress output - - -y - Disable confirmation prompt. - - --default-host - Choose a default host triple - - --default-toolchain - Choose a default toolchain to install. Use 'none' to not install any toolchains at all - - --profile - [default: default] [possible values: minimal, default, complete] - - -c, --component ... - Component name to also install - - -t, --target ... - Target name to also install - - --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 - Print help information - - -V, --version - Print version information +Usage: rustup-init[EXE] [OPTIONS] + +Options: + -v, --verbose + Enable verbose output + -q, --quiet + Disable progress output + -y + Disable confirmation prompt. + --default-host + Choose a default host triple + --default-toolchain + Choose a default toolchain to install. Use 'none' to not install any toolchains at all + --profile + [default: default] [possible values: minimal, default, complete] + -c, --component ... + Component name to also install + -t, --target ... + Target name to also install + --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 + Print help + -V, --version + Print version """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_check_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_check_cmd_help_flag_stdout.toml index 793768eb60..2ff2f744e5 100644 --- a/tests/suite/cli-ui/rustup/rustup_check_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_check_cmd_help_flag_stdout.toml @@ -1,13 +1,12 @@ bin.name = "rustup" -args = ["check","--help"] +args = ["check", "--help"] stdout = """ ... Check for updates to Rust toolchains and rustup -USAGE: - rustup[EXE] check +Usage: rustup[EXE] check -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_completions_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_completions_cmd_help_flag_stdout.toml index 309ed062fe..be05cb0cd9 100644 --- a/tests/suite/cli-ui/rustup/rustup_completions_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_completions_cmd_help_flag_stdout.toml @@ -1,20 +1,19 @@ bin.name = "rustup" -args = ["completions","--help"] +args = ["completions", "--help"] stdout = """ ... Generate tab-completion scripts for your shell -USAGE: - rustup[EXE] completions [ARGS] +Usage: rustup[EXE] completions [shell] [command] -ARGS: - [possible values: bash, elvish, fish, powershell, zsh] - [possible values: rustup, cargo] +Arguments: + [shell] [possible values: bash, elvish, fish, powershell, zsh] + [command] [possible values: rustup, cargo] -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help -DISCUSSION: +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 @@ -118,7 +117,7 @@ DISCUSSION: completions into our profile simply use PS C:/> rustup completions powershell >> -${env:USERPROFILE}/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 + ${env:USERPROFILE}/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 CARGO: diff --git a/tests/suite/cli-ui/rustup/rustup_component_cmd_add_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_component_cmd_add_cmd_help_flag_stdout.toml index 2dbd6b2192..10643c0603 100644 --- a/tests/suite/cli-ui/rustup/rustup_component_cmd_add_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_component_cmd_add_cmd_help_flag_stdout.toml @@ -1,19 +1,18 @@ bin.name = "rustup" -args = ["component","add","--help"] +args = ["component", "add", "--help"] stdout = """ ... Add a component to a Rust toolchain -USAGE: - rustup[EXE] component add [OPTIONS] ... +Usage: rustup[EXE] component add [OPTIONS] ... -ARGS: - ... +Arguments: + ... -OPTIONS: - --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` - --target - -h, --help Print help information +Options: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more + information see `rustup help toolchain` + --target + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_component_cmd_list_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_component_cmd_list_cmd_help_flag_stdout.toml index 221c90dcfa..366971263e 100644 --- a/tests/suite/cli-ui/rustup/rustup_component_cmd_list_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_component_cmd_list_cmd_help_flag_stdout.toml @@ -1,16 +1,15 @@ bin.name = "rustup" -args = ["component","list","--help"] +args = ["component", "list", "--help"] stdout = """ ... List installed and available components -USAGE: - rustup[EXE] component list [OPTIONS] +Usage: rustup[EXE] component list [OPTIONS] -OPTIONS: - --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` - --installed List only installed components - -h, --help Print help information +Options: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more + information see `rustup help toolchain` + --installed List only installed components + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_component_cmd_remove_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_component_cmd_remove_cmd_help_flag_stdout.toml index 917b72b041..1bb7c4042f 100644 --- a/tests/suite/cli-ui/rustup/rustup_component_cmd_remove_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_component_cmd_remove_cmd_help_flag_stdout.toml @@ -1,19 +1,18 @@ bin.name = "rustup" -args = ["component","remove","--help"] +args = ["component", "remove", "--help"] stdout = """ ... Remove a component from a Rust toolchain -USAGE: - rustup[EXE] component remove [OPTIONS] ... +Usage: rustup[EXE] component remove [OPTIONS] ... -ARGS: - ... +Arguments: + ... -OPTIONS: - --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` - --target - -h, --help Print help information +Options: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more + information see `rustup help toolchain` + --target + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_default_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_default_cmd_help_flag_stdout.toml index 834081ef85..48a3e93da7 100644 --- a/tests/suite/cli-ui/rustup/rustup_default_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_default_cmd_help_flag_stdout.toml @@ -1,20 +1,19 @@ bin.name = "rustup" -args = ["default","--help"] +args = ["default", "--help"] stdout = """ ... Set the default toolchain -USAGE: - rustup[EXE] default [toolchain] +Usage: rustup[EXE] default [toolchain] -ARGS: - Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information - see `rustup help toolchain` +Arguments: + [toolchain] Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help -DISCUSSION: +Discussion: Sets the default toolchain to the one specified. If the toolchain is not already installed then it is installed first. """ diff --git a/tests/suite/cli-ui/rustup/rustup_doc_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_doc_cmd_help_flag_stdout.toml index ec12561e41..034e8894b8 100644 --- a/tests/suite/cli-ui/rustup/rustup_doc_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_doc_cmd_help_flag_stdout.toml @@ -1,41 +1,40 @@ bin.name = "rustup" -args = ["doc","--help"] +args = ["doc", "--help"] stdout = """ ... Open the documentation for the current toolchain -USAGE: - rustup[EXE] doc [OPTIONS] [topic] +Usage: rustup[EXE] doc [OPTIONS] [topic] -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... +Arguments: + [topic] 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... -OPTIONS: - --path Only print the path to the documentation - --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` - --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 - --nomicon The Dark Arts of Advanced and Unsafe Rust Programming - --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 - --embedded-book The Embedded Rust Book - -h, --help Print help information +Options: + --path Only print the path to the documentation + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more + information see `rustup help toolchain` + --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 + --nomicon The Dark Arts of Advanced and Unsafe Rust Programming + --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 + --embedded-book The Embedded Rust Book + -h, --help Print help -DISCUSSION: +Discussion: Opens the documentation for the currently active toolchain with the default browser. diff --git a/tests/suite/cli-ui/rustup/rustup_help_cmd_stdout.toml b/tests/suite/cli-ui/rustup/rustup_help_cmd_stdout.toml index 68caeb20d7..48213fff94 100644 --- a/tests/suite/cli-ui/rustup/rustup_help_cmd_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_help_cmd_stdout.toml @@ -2,40 +2,38 @@ bin.name = "rustup" args = ["help"] status.code = 0 stdout = """ -rustup [..] The Rust toolchain installer -USAGE: - rustup[EXE] [OPTIONS] [+toolchain] +Usage: rustup[EXE] [OPTIONS] [+toolchain] -ARGS: - <+toolchain> release channel (e.g. +stable) or custom toolchain to set override +Commands: + 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 +... + self Modify the rustup installation + set Alter rustup settings + completions Generate tab-completion scripts for your shell + help Print this message or the help of the given subcommand(s) -OPTIONS: - -v, --verbose Enable verbose output - -q, --quiet Disable progress output - -h, --help Print help information - -V, --version Print version information +Arguments: + [+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 -... - self Modify the rustup installation - set Alter rustup settings - completions Generate tab-completion scripts for your shell - help Print this message or the help of the given subcommand(s) +Options: + -v, --verbose Enable verbose output + -q, --quiet Disable progress output + -h, --help Print help + -V, --version Print version -DISCUSSION: +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 diff --git a/tests/suite/cli-ui/rustup/rustup_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_help_flag_stdout.toml index c0f051e22a..694ce4263a 100644 --- a/tests/suite/cli-ui/rustup/rustup_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_help_flag_stdout.toml @@ -2,40 +2,38 @@ bin.name = "rustup" args = ["--help"] status.code = 0 stdout = """ -rustup [..] The Rust toolchain installer -USAGE: - rustup[EXE] [OPTIONS] [+toolchain] +Usage: rustup[EXE] [OPTIONS] [+toolchain] -ARGS: - <+toolchain> release channel (e.g. +stable) or custom toolchain to set override +Commands: + 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 +... + self Modify the rustup installation + set Alter rustup settings + completions Generate tab-completion scripts for your shell + help Print this message or the help of the given subcommand(s) -OPTIONS: - -v, --verbose Enable verbose output - -q, --quiet Disable progress output - -h, --help Print help information - -V, --version Print version information +Arguments: + [+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 -... - self Modify the rustup installation - set Alter rustup settings - completions Generate tab-completion scripts for your shell - help Print this message or the help of the given subcommand(s) +Options: + -v, --verbose Enable verbose output + -q, --quiet Disable progress output + -h, --help Print help + -V, --version Print version -DISCUSSION: +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 diff --git a/tests/suite/cli-ui/rustup/rustup_man_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_man_cmd_help_flag_stdout.toml index 6ec2336396..56740b66a9 100644 --- a/tests/suite/cli-ui/rustup/rustup_man_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_man_cmd_help_flag_stdout.toml @@ -1,18 +1,16 @@ bin.name = "rustup" -args = ["man","--help"] +args = ["man", "--help"] stdout = """ -... View the man page for a given command -USAGE: - rustup[EXE] man [OPTIONS] +Usage: rustup[EXE] man [OPTIONS] -ARGS: - +Arguments: + -OPTIONS: - --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` - -h, --help Print help information +Options: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more + information see `rustup help toolchain` + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_only_options_stdout.toml b/tests/suite/cli-ui/rustup/rustup_only_options_stdout.toml index e7d2600424..2364f92579 100644 --- a/tests/suite/cli-ui/rustup/rustup_only_options_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_only_options_stdout.toml @@ -1,48 +1,13 @@ bin.name = "rustup" args = ["-v"] status.code = 1 -stdout = """ -rustup [..] -The Rust toolchain installer +stdout = "" +stderr = """ +error: error: 'rustup[EXE]' requires a subcommand but one was not provided + [subcommands: dump-testament, show, install, uninstall, update, upgrade, up, check, default, toolchain, target, component, override, run, which, doc, docs, [..]self, set, completions, help] -USAGE: - rustup[EXE] [OPTIONS] [+toolchain] +Usage: rustup[EXE] [OPTIONS] [+toolchain] -ARGS: - <+toolchain> release channel (e.g. +stable) or custom toolchain to set override +For more information, try '--help'. -OPTIONS: - -v, --verbose Enable verbose output - -q, --quiet Disable progress output - -h, --help Print help information - -V, --version Print version information - -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 -... - self Modify the rustup installation - set Alter rustup settings - completions Generate tab-completion scripts for your shell - help Print 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/suite/cli-ui/rustup/rustup_override_cmd_add_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_override_cmd_add_cmd_help_flag_stdout.toml index d18211f0d7..1fcd4a24df 100644 --- a/tests/suite/cli-ui/rustup/rustup_override_cmd_add_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_override_cmd_add_cmd_help_flag_stdout.toml @@ -1,18 +1,17 @@ bin.name = "rustup" -args = ["override","add","--help"] +args = ["override", "add", "--help"] stdout = """ ... Set the override toolchain for a directory -USAGE: - rustup[EXE] override set [OPTIONS] +Usage: rustup[EXE] override set [OPTIONS] -ARGS: - Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information - see `rustup help toolchain` +Arguments: + Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` -OPTIONS: - --path Path to the directory - -h, --help Print help information +Options: + --path Path to the directory + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_override_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_override_cmd_help_flag_stdout.toml index 08b2daecbd..c604353e39 100644 --- a/tests/suite/cli-ui/rustup/rustup_override_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_override_cmd_help_flag_stdout.toml @@ -1,22 +1,21 @@ bin.name = "rustup" -args = ["override","--help"] +args = ["override", "--help"] stdout = """ ... Modify directory toolchain overrides -USAGE: - rustup[EXE] override +Usage: rustup[EXE] override -OPTIONS: - -h, --help Print help information +Commands: + list List directory toolchain overrides + set Set the override toolchain for a directory + unset Remove the override toolchain for a directory + help Print this message or the help of the given subcommand(s) -SUBCOMMANDS: - list List directory toolchain overrides - set Set the override toolchain for a directory - unset Remove the override toolchain for a directory - help Print this message or the help of the given subcommand(s) +Options: + -h, --help Print help -DISCUSSION: +Discussion: Overrides configure Rustup to use a specific toolchain when running in a specific directory. diff --git a/tests/suite/cli-ui/rustup/rustup_override_cmd_list_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_override_cmd_list_cmd_help_flag_stdout.toml index 8116d71751..1a1e735367 100644 --- a/tests/suite/cli-ui/rustup/rustup_override_cmd_list_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_override_cmd_list_cmd_help_flag_stdout.toml @@ -1,13 +1,12 @@ bin.name = "rustup" -args = ["override","list","--help"] +args = ["override", "list", "--help"] stdout = """ ... List directory toolchain overrides -USAGE: - rustup[EXE] override list +Usage: rustup[EXE] override list -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_override_cmd_remove_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_override_cmd_remove_cmd_help_flag_stdout.toml index 2bc53d6720..c94cb5d8ae 100644 --- a/tests/suite/cli-ui/rustup/rustup_override_cmd_remove_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_override_cmd_remove_cmd_help_flag_stdout.toml @@ -1,18 +1,17 @@ bin.name = "rustup" -args = ["override","unset","--help"] +args = ["override", "unset", "--help"] stdout = """ ... Remove the override toolchain for a directory -USAGE: - rustup[EXE] override unset [OPTIONS] +Usage: rustup[EXE] override unset [OPTIONS] -OPTIONS: - --path Path to the directory - --nonexistent Remove override toolchain for all nonexistent directories - -h, --help Print help information +Options: + --path Path to the directory + --nonexistent Remove override toolchain for all nonexistent directories + -h, --help Print help -DISCUSSION: +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 diff --git a/tests/suite/cli-ui/rustup/rustup_override_cmd_set_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_override_cmd_set_cmd_help_flag_stdout.toml index b1dc9680b5..a558fe24c9 100644 --- a/tests/suite/cli-ui/rustup/rustup_override_cmd_set_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_override_cmd_set_cmd_help_flag_stdout.toml @@ -1,18 +1,17 @@ bin.name = "rustup" -args = ["override","set","--help"] +args = ["override", "set", "--help"] stdout = """ ... Set the override toolchain for a directory -USAGE: - rustup[EXE] override set [OPTIONS] +Usage: rustup[EXE] override set [OPTIONS] -ARGS: - Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information - see `rustup help toolchain` +Arguments: + Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` -OPTIONS: - --path Path to the directory - -h, --help Print help information +Options: + --path Path to the directory + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_override_cmd_unset_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_override_cmd_unset_cmd_help_flag_stdout.toml index 2bc53d6720..c94cb5d8ae 100644 --- a/tests/suite/cli-ui/rustup/rustup_override_cmd_unset_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_override_cmd_unset_cmd_help_flag_stdout.toml @@ -1,18 +1,17 @@ bin.name = "rustup" -args = ["override","unset","--help"] +args = ["override", "unset", "--help"] stdout = """ ... Remove the override toolchain for a directory -USAGE: - rustup[EXE] override unset [OPTIONS] +Usage: rustup[EXE] override unset [OPTIONS] -OPTIONS: - --path Path to the directory - --nonexistent Remove override toolchain for all nonexistent directories - -h, --help Print help information +Options: + --path Path to the directory + --nonexistent Remove override toolchain for all nonexistent directories + -h, --help Print help -DISCUSSION: +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 diff --git a/tests/suite/cli-ui/rustup/rustup_run_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_run_cmd_help_flag_stdout.toml index 9b38e69351..0f59c2cec3 100644 --- a/tests/suite/cli-ui/rustup/rustup_run_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_run_cmd_help_flag_stdout.toml @@ -1,22 +1,21 @@ bin.name = "rustup" -args = ["run","--help"] +args = ["run", "--help"] stdout = """ ... Run a command with an environment configured for a given toolchain -USAGE: - rustup[EXE] run [OPTIONS] ... +Usage: rustup[EXE] run [OPTIONS] ... -ARGS: - Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` - ... +Arguments: + Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` + ... -OPTIONS: - --install Install the requested toolchain if needed - -h, --help Print help information +Options: + --install Install the requested toolchain if needed + -h, --help Print help -DISCUSSION: +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 diff --git a/tests/suite/cli-ui/rustup/rustup_self_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_self_cmd_help_flag_stdout.toml index 9c0ff9d9c3..7c19ce818a 100644 --- a/tests/suite/cli-ui/rustup/rustup_self_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_self_cmd_help_flag_stdout.toml @@ -1,19 +1,18 @@ bin.name = "rustup" -args = ["self","--help"] +args = ["self", "--help"] stdout = """ ... Modify the rustup installation -USAGE: - rustup[EXE] self +Usage: rustup[EXE] self -OPTIONS: - -h, --help Print help information +Commands: + update Download and install updates to rustup + uninstall Uninstall rustup. + upgrade-data Upgrade the internal data format. + help Print this message or the help of the given subcommand(s) -SUBCOMMANDS: - update Download and install updates to rustup - uninstall Uninstall rustup. - upgrade-data Upgrade the internal data format. - help Print this message or the help of the given subcommand(s) +Options: + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_self_cmd_uninstall_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_self_cmd_uninstall_cmd_help_flag_stdout.toml index 28628dcd3a..ab5a5fa902 100644 --- a/tests/suite/cli-ui/rustup/rustup_self_cmd_uninstall_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_self_cmd_uninstall_cmd_help_flag_stdout.toml @@ -1,14 +1,13 @@ bin.name = "rustup" -args = ["self","uninstall","--help"] +args = ["self", "uninstall", "--help"] stdout = """ ... Uninstall rustup. -USAGE: - rustup[EXE] self uninstall [OPTIONS] +Usage: rustup[EXE] self uninstall [OPTIONS] -OPTIONS: - -y - -h, --help Print help information +Options: + -y + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_self_cmd_update_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_self_cmd_update_cmd_help_flag_stdout.toml index cbd215987a..90ffe32d71 100644 --- a/tests/suite/cli-ui/rustup/rustup_self_cmd_update_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_self_cmd_update_cmd_help_flag_stdout.toml @@ -1,13 +1,12 @@ bin.name = "rustup" -args = ["self","update","--help"] +args = ["self", "update", "--help"] stdout = """ ... Download and install updates to rustup -USAGE: - rustup[EXE] self update +Usage: rustup[EXE] self update -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_self_cmd_upgrade-data _cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_self_cmd_upgrade-data _cmd_help_flag_stdout.toml index c06b9a03f9..c010dc709e 100644 --- a/tests/suite/cli-ui/rustup/rustup_self_cmd_upgrade-data _cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_self_cmd_upgrade-data _cmd_help_flag_stdout.toml @@ -1,13 +1,12 @@ bin.name = "rustup" -args = ["self","upgrade-data","--help"] +args = ["self", "upgrade-data", "--help"] stdout = """ ... Upgrade the internal data format. -USAGE: - rustup[EXE] self upgrade-data +Usage: rustup[EXE] self upgrade-data -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_set_cmd_auto-self-update_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_set_cmd_auto-self-update_cmd_help_flag_stdout.toml index 0bcce67e6f..efc70e0fed 100644 --- a/tests/suite/cli-ui/rustup/rustup_set_cmd_auto-self-update_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_set_cmd_auto-self-update_cmd_help_flag_stdout.toml @@ -1,16 +1,15 @@ bin.name = "rustup" -args = ["set","auto-self-update","--help"] +args = ["set", "auto-self-update", "--help"] stdout = """ ... The rustup auto self update mode -USAGE: - rustup[EXE] set auto-self-update +Usage: rustup[EXE] set auto-self-update -ARGS: - [default: enable] [possible values: enable, disable, check-only] +Arguments: + [default: enable] [possible values: enable, disable, check-only] -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_set_cmd_default-host_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_set_cmd_default-host_cmd_help_flag_stdout.toml index 3b5a9421ad..7238ccf21d 100644 --- a/tests/suite/cli-ui/rustup/rustup_set_cmd_default-host_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_set_cmd_default-host_cmd_help_flag_stdout.toml @@ -1,16 +1,15 @@ bin.name = "rustup" -args = ["set","default-host","--help"] +args = ["set", "default-host", "--help"] stdout = """ ... The triple used to identify toolchains when not specified -USAGE: - rustup[EXE] set default-host +Usage: rustup[EXE] set default-host -ARGS: - +Arguments: + -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_set_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_set_cmd_help_flag_stdout.toml index 8522656129..a6134667a6 100644 --- a/tests/suite/cli-ui/rustup/rustup_set_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_set_cmd_help_flag_stdout.toml @@ -1,19 +1,18 @@ bin.name = "rustup" -args = ["set","--help"] +args = ["set", "--help"] stdout = """ ... Alter rustup settings -USAGE: - rustup[EXE] set +Usage: rustup[EXE] set -OPTIONS: - -h, --help Print help information +Commands: + default-host The triple used to identify toolchains when not specified + profile The default components installed + auto-self-update The rustup auto self update mode + help Print this message or the help of the given subcommand(s) -SUBCOMMANDS: - default-host The triple used to identify toolchains when not specified - profile The default components installed - auto-self-update The rustup auto self update mode - help Print this message or the help of the given subcommand(s) +Options: + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_set_cmd_profile_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_set_cmd_profile_cmd_help_flag_stdout.toml index 7013e21433..867e77412a 100644 --- a/tests/suite/cli-ui/rustup/rustup_set_cmd_profile_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_set_cmd_profile_cmd_help_flag_stdout.toml @@ -1,16 +1,15 @@ bin.name = "rustup" -args = ["set","profile","--help"] +args = ["set", "profile", "--help"] stdout = """ ... The default components installed -USAGE: - rustup[EXE] set profile +Usage: rustup[EXE] set profile -ARGS: - [default: default] [possible values: minimal, default, complete] +Arguments: + [default: default] [possible values: minimal, default, complete] -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_show_cmd_active-toolchain_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_show_cmd_active-toolchain_cmd_help_flag_stdout.toml index 0bd8de5fe5..d06aab867e 100644 --- a/tests/suite/cli-ui/rustup/rustup_show_cmd_active-toolchain_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_show_cmd_active-toolchain_cmd_help_flag_stdout.toml @@ -1,17 +1,16 @@ bin.name = "rustup" -args = ["show","active-toolchain","--help"] +args = ["show", "active-toolchain", "--help"] stdout = """ ... Show the active toolchain -USAGE: - rustup[EXE] show active-toolchain [OPTIONS] +Usage: rustup[EXE] show active-toolchain [OPTIONS] -OPTIONS: - -v, --verbose Enable verbose output with rustc information - -h, --help Print help information +Options: + -v, --verbose Enable verbose output with rustc information + -h, --help Print help -DISCUSSION: +Discussion: Shows the name of the active toolchain. This is useful for figuring out the active tool chain from diff --git a/tests/suite/cli-ui/rustup/rustup_show_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_show_cmd_help_flag_stdout.toml index fa05eee33a..9d1c081153 100644 --- a/tests/suite/cli-ui/rustup/rustup_show_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_show_cmd_help_flag_stdout.toml @@ -1,23 +1,22 @@ bin.name = "rustup" -args = ["show","--help"] +args = ["show", "--help"] stdout = """ ... Show the active and installed toolchains or profiles -USAGE: - rustup[EXE] show [OPTIONS] [SUBCOMMAND] +Usage: rustup[EXE] show [OPTIONS] [COMMAND] -OPTIONS: - -v, --verbose Enable verbose output with rustc information for all installed toolchains - -h, --help Print help information +Commands: + active-toolchain Show the active toolchain + home Display the computed value of RUSTUP_HOME + profile Show the current profile + help Print this message or the help of the given subcommand(s) -SUBCOMMANDS: - active-toolchain Show the active toolchain - home Display the computed value of RUSTUP_HOME - profile Show the current profile - help Print this message or the help of the given subcommand(s) +Options: + -v, --verbose Enable verbose output with rustc information for all installed toolchains + -h, --help Print help -DISCUSSION: +Discussion: Shows the name of the active toolchain and the version of `rustc`. If the active toolchain has installed support for additional diff --git a/tests/suite/cli-ui/rustup/rustup_show_cmd_home_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_show_cmd_home_cmd_help_flag_stdout.toml index a852be1033..6283c5e97a 100644 --- a/tests/suite/cli-ui/rustup/rustup_show_cmd_home_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_show_cmd_home_cmd_help_flag_stdout.toml @@ -1,13 +1,12 @@ bin.name = "rustup" -args = ["show","home","--help"] +args = ["show", "home", "--help"] stdout = """ ... Display the computed value of RUSTUP_HOME -USAGE: - rustup[EXE] show home +Usage: rustup[EXE] show home -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_show_cmd_profile_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_show_cmd_profile_cmd_help_flag_stdout.toml index 32ec3e8347..495524dd16 100644 --- a/tests/suite/cli-ui/rustup/rustup_show_cmd_profile_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_show_cmd_profile_cmd_help_flag_stdout.toml @@ -1,13 +1,12 @@ bin.name = "rustup" -args = ["show","profile","--help"] +args = ["show", "profile", "--help"] stdout = """ ... Show the current profile -USAGE: - rustup[EXE] show profile +Usage: rustup[EXE] show profile -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_target_cmd_add_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_target_cmd_add_cmd_help_flag_stdout.toml index 688b6f428e..c8135fbd3c 100644 --- a/tests/suite/cli-ui/rustup/rustup_target_cmd_add_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_target_cmd_add_cmd_help_flag_stdout.toml @@ -1,18 +1,17 @@ bin.name = "rustup" -args = ["target","add","--help"] +args = ["target", "add", "--help"] stdout = """ ... Add a target to a Rust toolchain -USAGE: - rustup[EXE] target add [OPTIONS] ... +Usage: rustup[EXE] target add [OPTIONS] ... -ARGS: - ... List of targets to install; \"all\" installs all available targets +Arguments: + ... List of targets to install; \"all\" installs all available targets -OPTIONS: - --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` - -h, --help Print help information +Options: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more + information see `rustup help toolchain` + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_target_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_target_cmd_help_flag_stdout.toml index 4872b92191..c5ed7dca27 100644 --- a/tests/suite/cli-ui/rustup/rustup_target_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_target_cmd_help_flag_stdout.toml @@ -1,19 +1,18 @@ bin.name = "rustup" -args = ["target","--help"] +args = ["target", "--help"] stdout = """ ... Modify a toolchain's supported targets -USAGE: - rustup[EXE] target +Usage: rustup[EXE] target -OPTIONS: - -h, --help Print help information +Commands: + list List installed and available targets + add Add a target to a Rust toolchain + remove Remove a target from a Rust toolchain + help Print this message or the help of the given subcommand(s) -SUBCOMMANDS: - list List installed and available targets - add Add a target to a Rust toolchain - remove Remove a target from a Rust toolchain - help Print this message or the help of the given subcommand(s) +Options: + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_target_cmd_list_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_target_cmd_list_cmd_help_flag_stdout.toml index 07691abfc5..1da9b11e1d 100644 --- a/tests/suite/cli-ui/rustup/rustup_target_cmd_list_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_target_cmd_list_cmd_help_flag_stdout.toml @@ -1,16 +1,15 @@ bin.name = "rustup" -args = ["target","list","--help"] +args = ["target", "list", "--help"] stdout = """ ... List installed and available targets -USAGE: - rustup[EXE] target list [OPTIONS] +Usage: rustup[EXE] target list [OPTIONS] -OPTIONS: - --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` - --installed List only installed targets - -h, --help Print help information +Options: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more + information see `rustup help toolchain` + --installed List only installed targets + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_target_cmd_remove_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_target_cmd_remove_cmd_help_flag_stdout.toml index 60abfefede..1a19cc7e05 100644 --- a/tests/suite/cli-ui/rustup/rustup_target_cmd_remove_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_target_cmd_remove_cmd_help_flag_stdout.toml @@ -1,18 +1,17 @@ bin.name = "rustup" -args = ["target","remove","--help"] +args = ["target", "remove", "--help"] stdout = """ ... Remove a target from a Rust toolchain -USAGE: - rustup[EXE] target remove [OPTIONS] ... +Usage: rustup[EXE] target remove [OPTIONS] ... -ARGS: - ... List of targets to uninstall +Arguments: + ... List of targets to uninstall -OPTIONS: - --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` - -h, --help Print help information +Options: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more + information see `rustup help toolchain` + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_help_flag_stdout.toml index 7a9bc0faae..0fcec7dd43 100644 --- a/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_help_flag_stdout.toml @@ -1,23 +1,22 @@ bin.name = "rustup" -args = ["toolchain","--help"] +args = ["toolchain", "--help"] stdout = """ ... Modify or query the installed toolchains -USAGE: - rustup[EXE] toolchain +Usage: rustup[EXE] toolchain -OPTIONS: - -h, --help Print help information +Commands: + 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 Print this message or the help of the given subcommand(s) -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 Print this message or the help of the given subcommand(s) +Options: + -h, --help Print help -DISCUSSION: +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 diff --git a/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_install_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_install_cmd_help_flag_stdout.toml index b3769d1b48..a882c9f727 100644 --- a/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_install_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_install_cmd_help_flag_stdout.toml @@ -1,27 +1,25 @@ bin.name = "rustup" -args = ["toolchain","install","--help"] +args = ["toolchain", "install", "--help"] stdout = """ -... Install or update a given toolchain -USAGE: - rustup[EXE] toolchain install [OPTIONS] ... +Usage: rustup[EXE] toolchain install [OPTIONS] ... -ARGS: - ... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` +Arguments: + ... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` -OPTIONS: - --profile [possible values: minimal, default, complete] - -c, --component ... Add specific components on installation - -t, --target ... Add specific targets on installation - --no-self-update Don't perform self update when running the`rustup toolchain - install` command - --force Force an update, even if some components are missing - --allow-downgrade Allow rustup to downgrade the toolchain to satisfy your - component choice - --force-non-host Install toolchains that require an emulator. See - https://github.com/rust-lang/rustup/wiki/Non-host-toolchains - -h, --help Print help information +Options: + --profile [possible values: minimal, default, complete] + -c, --component ... Add specific components on installation + -t, --target ... Add specific targets on installation + --no-self-update Don't perform self update when running the`rustup toolchain + install` command + --force Force an update, even if some components are missing + --allow-downgrade Allow rustup to downgrade the toolchain to satisfy your component + choice + --force-non-host Install toolchains that require an emulator. See + https://github.com/rust-lang/rustup/wiki/Non-host-toolchains + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_link_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_link_cmd_help_flag_stdout.toml index 57bb36057b..b37a4401d4 100644 --- a/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_link_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_link_cmd_help_flag_stdout.toml @@ -1,20 +1,19 @@ bin.name = "rustup" -args = ["toolchain","link","--help"] +args = ["toolchain", "link", "--help"] stdout = """ ... Create a custom toolchain by symlinking to a directory -USAGE: - rustup[EXE] toolchain link +Usage: rustup[EXE] toolchain link -ARGS: - Custom toolchain name - Path to the directory +Arguments: + Custom toolchain name + Path to the directory -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help -DISCUSSION: +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 diff --git a/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_list_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_list_cmd_help_flag_stdout.toml index d2592440e9..50609f8c8e 100644 --- a/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_list_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_list_cmd_help_flag_stdout.toml @@ -1,14 +1,13 @@ bin.name = "rustup" -args = ["toolchain","list","--help"] +args = ["toolchain", "list", "--help"] stdout = """ ... List installed toolchains -USAGE: - rustup[EXE] toolchain list [OPTIONS] +Usage: rustup[EXE] toolchain list [OPTIONS] -OPTIONS: - -v, --verbose Enable verbose output with toolchain information - -h, --help Print help information +Options: + -v, --verbose Enable verbose output with toolchain information + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_uninstall_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_uninstall_cmd_help_flag_stdout.toml index 66a9f9b1d1..fac68960ac 100644 --- a/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_uninstall_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_toolchain_cmd_uninstall_cmd_help_flag_stdout.toml @@ -1,17 +1,16 @@ bin.name = "rustup" -args = ["toolchain","uninstall","--help"] +args = ["toolchain", "uninstall", "--help"] stdout = """ ... Uninstall a toolchain -USAGE: - rustup[EXE] toolchain uninstall ... +Usage: rustup[EXE] toolchain uninstall ... -ARGS: - ... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` +Arguments: + ... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli-ui/rustup/rustup_unknown_arg_stdout.toml b/tests/suite/cli-ui/rustup/rustup_unknown_arg_stdout.toml index 7508714f03..2aff249014 100644 --- a/tests/suite/cli-ui/rustup/rustup_unknown_arg_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_unknown_arg_stdout.toml @@ -3,7 +3,7 @@ args = ["random"] status.code = 1 stdout = "" stderr = """ -error: Invalid value \"random\" for '<+toolchain>': \"random\" is not a valid subcommand, so it was interpreted as a toolchain name, but it is also invalid. To override the toolchain using the 'rustup +toolchain' syntax, make sure to prefix the toolchain override with a '+' +error: invalid value 'random' for '[+toolchain]': \"random\" is not a valid subcommand, so it was interpreted as a toolchain name, but it is also invalid. To override the toolchain using the 'rustup +toolchain' syntax, make sure to prefix the toolchain override with a '+' -For more information try --help +For more information, try '--help'. """ diff --git a/tests/suite/cli-ui/rustup/rustup_up_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_up_cmd_help_flag_stdout.toml index e60aced4fd..3fc547c6f9 100644 --- a/tests/suite/cli-ui/rustup/rustup_up_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_up_cmd_help_flag_stdout.toml @@ -1,24 +1,23 @@ bin.name = "rustup" -args = ["up","--help"] +args = ["up", "--help"] stdout = """ ... Update Rust toolchains and rustup -USAGE: - rustup[EXE] update [OPTIONS] [toolchain]... +Usage: rustup[EXE] update [OPTIONS] [toolchain]... -ARGS: - ... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` +Arguments: + [toolchain]... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` -OPTIONS: - --no-self-update Don't perform self update when running the `rustup update` command - --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 Print help information +Options: + --no-self-update Don't perform self update when running the `rustup update` command + --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 Print help -DISCUSSION: +Discussion: With no toolchain specified, the `update` command updates each of the installed toolchains from the official release channels, then updates rustup itself. diff --git a/tests/suite/cli-ui/rustup/rustup_update_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_update_cmd_help_flag_stdout.toml index 40ffc935f7..823b6f8501 100644 --- a/tests/suite/cli-ui/rustup/rustup_update_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_update_cmd_help_flag_stdout.toml @@ -1,24 +1,23 @@ bin.name = "rustup" -args = ["update","--help"] +args = ["update", "--help"] stdout = """ ... Update Rust toolchains and rustup -USAGE: - rustup[EXE] update [OPTIONS] [toolchain]... +Usage: rustup[EXE] update [OPTIONS] [toolchain]... -ARGS: - ... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` +Arguments: + [toolchain]... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` -OPTIONS: - --no-self-update Don't perform self update when running the `rustup update` command - --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 Print help information +Options: + --no-self-update Don't perform self update when running the `rustup update` command + --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 Print help -DISCUSSION: +Discussion: With no toolchain specified, the `update` command updates each of the installed toolchains from the official release channels, then updates rustup itself. diff --git a/tests/suite/cli-ui/rustup/rustup_upgrade_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_upgrade_cmd_help_flag_stdout.toml index 2153d7ecbf..8c5b39ce17 100644 --- a/tests/suite/cli-ui/rustup/rustup_upgrade_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_upgrade_cmd_help_flag_stdout.toml @@ -1,24 +1,23 @@ bin.name = "rustup" -args = ["upgrade","--help"] +args = ["upgrade", "--help"] stdout = """ ... Update Rust toolchains and rustup -USAGE: - rustup[EXE] update [OPTIONS] [toolchain]... +Usage: rustup[EXE] update [OPTIONS] [toolchain]... -ARGS: - ... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` +Arguments: + [toolchain]... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see + `rustup help toolchain` -OPTIONS: - --no-self-update Don't perform self update when running the `rustup update` command - --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 Print help information +Options: + --no-self-update Don't perform self update when running the `rustup update` command + --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 Print help -DISCUSSION: +Discussion: With no toolchain specified, the `update` command updates each of the installed toolchains from the official release channels, then updates rustup itself. diff --git a/tests/suite/cli-ui/rustup/rustup_which_cmd_help_flag_stdout.toml b/tests/suite/cli-ui/rustup/rustup_which_cmd_help_flag_stdout.toml index 97a4c96cd1..296c074ef0 100644 --- a/tests/suite/cli-ui/rustup/rustup_which_cmd_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_which_cmd_help_flag_stdout.toml @@ -1,18 +1,17 @@ bin.name = "rustup" -args = ["which","--help"] +args = ["which", "--help"] stdout = """ ... Display which binary will be run for a given command -USAGE: - rustup[EXE] which [OPTIONS] +Usage: rustup[EXE] which [OPTIONS] -ARGS: - +Arguments: + -OPTIONS: - --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more - information see `rustup help toolchain` - -h, --help Print help information +Options: + --toolchain Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more + information see `rustup help toolchain` + -h, --help Print help """ stderr = "" diff --git a/tests/suite/cli_misc.rs b/tests/suite/cli_misc.rs index 1b0f92953e..23e9040428 100644 --- a/tests/suite/cli_misc.rs +++ b/tests/suite/cli_misc.rs @@ -145,7 +145,7 @@ fn subcommand_required_for_target() { let out = cmd.output().unwrap(); assert!(!out.status.success()); assert_eq!(out.status.code().unwrap(), 1); - assert!(str::from_utf8(&out.stdout).unwrap().contains("USAGE")); + assert!(str::from_utf8(&out.stderr).unwrap().contains("Usage")); }); } @@ -159,7 +159,7 @@ fn subcommand_required_for_toolchain() { let out = cmd.output().unwrap(); assert!(!out.status.success()); assert_eq!(out.status.code().unwrap(), 1); - assert!(str::from_utf8(&out.stdout).unwrap().contains("USAGE")); + assert!(str::from_utf8(&out.stderr).unwrap().contains("Usage")); }); } @@ -173,7 +173,7 @@ fn subcommand_required_for_override() { let out = cmd.output().unwrap(); assert!(!out.status.success()); assert_eq!(out.status.code().unwrap(), 1); - assert!(str::from_utf8(&out.stdout).unwrap().contains("USAGE")); + assert!(str::from_utf8(&out.stderr).unwrap().contains("Usage")); }); } @@ -187,7 +187,7 @@ fn subcommand_required_for_self() { let out = cmd.output().unwrap(); assert!(!out.status.success()); assert_eq!(out.status.code().unwrap(), 1); - assert!(str::from_utf8(&out.stdout).unwrap().contains("USAGE")); + assert!(str::from_utf8(&out.stderr).unwrap().contains("Usage")); }); } @@ -807,11 +807,11 @@ fn completion_bad_shell() { setup(&|config| { config.expect_err( &["rustup", "completions", "fake"], - r#"error: "fake" isn't a valid value for ''"#, + r#"error: invalid value 'fake' for '[shell]'"#, ); config.expect_err( &["rustup", "completions", "fake", "cargo"], - r#"error: "fake" isn't a valid value for ''"#, + r#"error: invalid value 'fake' for '[shell]'"#, ); }); } @@ -821,7 +821,7 @@ fn completion_bad_tool() { setup(&|config| { config.expect_err( &["rustup", "completions", "bash", "fake"], - r#"error: "fake" isn't a valid value for ''"#, + r#"error: invalid value 'fake' for '[command]'"#, ); }); } diff --git a/tests/suite/cli_v2.rs b/tests/suite/cli_v2.rs index 54d2c4c3ab..d5cf050565 100644 --- a/tests/suite/cli_v2.rs +++ b/tests/suite/cli_v2.rs @@ -1029,7 +1029,7 @@ fn update_unavailable_std() { setup(&|config| { make_component_unavailable(config, "rust-std", &this_host_triple()); config.expect_err( - &["rustup", "update", "nightly", ], + &["rustup", "update", "nightly"], for_host!( "component 'rust-std' for target '{0}' is unavailable for download for channel 'nightly'" ),