From 56bdd5861a096a52426bbb6d38d2e068db8fde8a Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 15 Aug 2023 10:24:36 +0200 Subject: [PATCH] Upgrade to clap 4 --- Cargo.lock | 110 +++--------------- Cargo.toml | 4 +- rustup-init.sh | 67 +++++------ src/cli/rustup_mode.rs | 87 ++++++-------- src/cli/setup_mode.rs | 18 ++- .../rustup-init_help_flag_stdout.toml | 67 +++++------ .../rustup-init_sh_help_flag_stdout.toml | 67 +++++------ .../rustup_check_cmd_help_flag_stdout.toml | 7 +- ...stup_completions_cmd_help_flag_stdout.toml | 15 ++- ...omponent_cmd_add_cmd_help_flag_stdout.toml | 17 ++- ...mponent_cmd_list_cmd_help_flag_stdout.toml | 13 +-- ...onent_cmd_remove_cmd_help_flag_stdout.toml | 17 ++- .../rustup_default_cmd_help_flag_stdout.toml | 13 +-- .../rustup_doc_cmd_help_flag_stdout.toml | 55 +++++---- .../cli-ui/rustup/rustup_help_cmd_stdout.toml | 52 ++++----- .../rustup/rustup_help_flag_stdout.toml | 52 ++++----- .../rustup_man_cmd_help_flag_stdout.toml | 15 ++- .../rustup/rustup_only_options_stdout.toml | 47 +------- ...override_cmd_add_cmd_help_flag_stdout.toml | 15 ++- .../rustup_override_cmd_help_flag_stdout.toml | 17 ++- ...verride_cmd_list_cmd_help_flag_stdout.toml | 7 +- ...rride_cmd_remove_cmd_help_flag_stdout.toml | 11 +- ...override_cmd_set_cmd_help_flag_stdout.toml | 15 ++- ...erride_cmd_unset_cmd_help_flag_stdout.toml | 11 +- .../rustup_run_cmd_help_flag_stdout.toml | 17 ++- .../rustup_self_cmd_help_flag_stdout.toml | 17 ++- ...lf_cmd_uninstall_cmd_help_flag_stdout.toml | 9 +- ..._self_cmd_update_cmd_help_flag_stdout.toml | 7 +- ...md_upgrade-data _cmd_help_flag_stdout.toml | 7 +- ...auto-self-update_cmd_help_flag_stdout.toml | 11 +- ...cmd_default-host_cmd_help_flag_stdout.toml | 11 +- .../rustup_set_cmd_help_flag_stdout.toml | 17 ++- ..._set_cmd_profile_cmd_help_flag_stdout.toml | 11 +- ...active-toolchain_cmd_help_flag_stdout.toml | 9 +- .../rustup_show_cmd_help_flag_stdout.toml | 19 ++- ...up_show_cmd_home_cmd_help_flag_stdout.toml | 7 +- ...show_cmd_profile_cmd_help_flag_stdout.toml | 7 +- ...p_target_cmd_add_cmd_help_flag_stdout.toml | 15 ++- .../rustup_target_cmd_help_flag_stdout.toml | 17 ++- ..._target_cmd_list_cmd_help_flag_stdout.toml | 13 +-- ...arget_cmd_remove_cmd_help_flag_stdout.toml | 15 ++- ...rustup_toolchain_cmd_help_flag_stdout.toml | 23 ++-- ...hain_cmd_install_cmd_help_flag_stdout.toml | 33 +++--- ...olchain_cmd_link_cmd_help_flag_stdout.toml | 13 +-- ...olchain_cmd_list_cmd_help_flag_stdout.toml | 9 +- ...in_cmd_uninstall_cmd_help_flag_stdout.toml | 13 +-- .../rustup/rustup_unknown_arg_stdout.toml | 4 +- .../rustup_up_cmd_help_flag_stdout.toml | 21 ++-- .../rustup_update_cmd_help_flag_stdout.toml | 21 ++-- .../rustup_upgrade_cmd_help_flag_stdout.toml | 21 ++-- .../rustup_which_cmd_help_flag_stdout.toml | 15 ++- tests/suite/cli_misc.rs | 14 +-- tests/suite/cli_self_upd.rs | 2 +- tests/suite/cli_ui.rs | 5 +- tests/suite/cli_v2.rs | 2 +- 55 files changed, 503 insertions(+), 701 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 76e5a090676..e43497e88e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -120,17 +120,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" @@ -287,51 +276,40 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.25" +version = "4.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +checksum = "c27cdf28c0f604ba3f512b0c9a409f8de8513e4816705deb0498b627e7c3a3fd" dependencies = [ - "atty", - "bitflags 1.3.2", - "clap_derive", - "clap_lex", - "indexmap", - "strsim", - "termcolor", - "terminal_size", - "textwrap", + "clap_builder", ] [[package]] -name = "clap_complete" -version = "3.2.5" +name = "clap_builder" +version = "4.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f7a2e0a962c45ce25afce14220bc24f9dade0a1787f185cecf96bfba7847cd8" +checksum = "08a9f1ab5e9f01a9b81f202e8562eb9a10de70abf9eaeac1be465c28b75aa4aa" dependencies = [ - "clap", + "anstream", + "anstyle", + "clap_lex", + "strsim", + "terminal_size", ] [[package]] -name = "clap_derive" -version = "3.2.25" +name = "clap_complete" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +checksum = "5fc443334c81a804575546c5a8a79b4913b50e28d69232903604cada1de817ce" dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", + "clap", ] [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "colorchoice" @@ -828,21 +806,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "heck" -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" @@ -1440,12 +1403,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" @@ -1502,30 +1459,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" version = "1.0.63" @@ -2294,15 +2227,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 a49692f5747..1847e7e3908 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,8 +49,8 @@ test = ["dep:once_cell", "dep:walkdir"] anyhow.workspace = true cfg-if = "1.0" chrono = { version = "0.4", default-features = false, features = ["std"] } -clap = { version = "3", features = ["deprecated", "wrap_help"] } -clap_complete = "3" +clap = { version = "4", features = ["wrap_help"] } +clap_complete = "4" derivative.workspace = true download = { path = "download", default-features = false } effective-limits = "0.5.5" diff --git a/rustup-init.sh b/rustup-init.sh index 58e66df8b24..eaec59a9c3f 100755 --- a/rustup-init.sh +++ b/rustup-init.sh @@ -26,47 +26,36 @@ RUSTUP_UPDATE_ROOT="${RUSTUP_UPDATE_ROOT:-https://static.rust-lang.org/rustup}" 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 +The installer for rustup - -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/rustup_mode.rs b/src/cli/rustup_mode.rs index 77c8d66e27b..1f813d65ac5 100644 --- a/src/cli/rustup_mode.rs +++ b/src/cli/rustup_mode.rs @@ -6,8 +6,8 @@ use std::str::FromStr; use anyhow::{anyhow, 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; @@ -89,7 +89,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 => { @@ -247,12 +247,11 @@ 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) .subcommand_required(true) .arg_required_else_help(true) .arg( @@ -270,10 +269,11 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("+toolchain") .help("release channel (e.g. +stable) or custom toolchain to set override") .value_parser(|s: &str| { + use clap::{Error, error::ErrorKind}; if let Some(stripped) = s.strip_prefix('+') { - ResolvableToolchainName::try_from(stripped).map_err(|e| clap::Error::raw(clap::ErrorKind::InvalidValue, e)) + ResolvableToolchainName::try_from(stripped).map_err(|e| Error::raw(ErrorKind::InvalidValue, e)) } else { - Err(clap::Error::raw(clap::ErrorKind::InvalidSubcommand, format!("\"{s}\" is not a valid subcommand, so it was interpreted as a toolchain name, but it is also invalid. {TOOLCHAIN_OVERRIDE_ERROR}"))) + Err(Error::raw(ErrorKind::InvalidSubcommand, format!("\"{s}\" is not a valid subcommand, so it was interpreted as a toolchain name, but it is also invalid. {TOOLCHAIN_OVERRIDE_ERROR}"))) } }), ) @@ -313,14 +313,13 @@ pub(crate) fn cli() -> Command<'static> { .help(OFFICIAL_TOOLCHAIN_ARG_HELP) .required(true) .value_parser(partial_toolchain_desc_parser) - .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") @@ -349,8 +348,7 @@ pub(crate) fn cli() -> Command<'static> { .help(RESOLVABLE_TOOLCHAIN_ARG_HELP) .required(true) .value_parser(resolvable_toolchainame_parser) - .takes_value(true) - .multiple_values(true), + .num_args(1..) ), ) .subcommand( @@ -363,8 +361,7 @@ pub(crate) fn cli() -> Command<'static> { .help(OFFICIAL_TOOLCHAIN_ARG_HELP) .required(false) .value_parser(partial_toolchain_desc_parser) - .takes_value(true) - .multiple_values(true), + .num_args(1..) ) .arg( Arg::new("no-self-update") @@ -419,22 +416,20 @@ pub(crate) fn cli() -> Command<'static> { .help(OFFICIAL_TOOLCHAIN_ARG_HELP) .required(true) .value_parser( partial_toolchain_desc_parser) - .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) + .num_args(1..) .use_value_delimiter(true) .action(ArgAction::Append), ) @@ -443,8 +438,7 @@ pub(crate) fn cli() -> Command<'static> { .help("Add specific targets on installation") .long("target") .short('t') - .takes_value(true) - .multiple_values(true) + .num_args(1..) .use_value_delimiter(true) .action(ArgAction::Append), ) @@ -455,7 +449,6 @@ pub(crate) fn cli() -> Command<'static> { `rustup toolchain install` command", ) .long("no-self-update") - .takes_value(true) .action(ArgAction::SetTrue) ) .arg( @@ -486,8 +479,7 @@ pub(crate) fn cli() -> Command<'static> { .help(RESOLVABLE_TOOLCHAIN_ARG_HELP) .required(true) .value_parser(resolvable_toolchainame_parser) - .takes_value(true) - .multiple_values(true), + .num_args(1..) ), ) .subcommand( @@ -520,7 +512,7 @@ pub(crate) fn cli() -> Command<'static> { .help(OFFICIAL_TOOLCHAIN_ARG_HELP) .long("toolchain") .value_parser(partial_toolchain_desc_parser) - .takes_value(true), + .num_args(1), ) .arg( Arg::new("installed") @@ -536,8 +528,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" @@ -547,7 +538,7 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(OFFICIAL_TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true) + .num_args(1) .value_parser(partial_toolchain_desc_parser), ), ) @@ -559,14 +550,13 @@ 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(OFFICIAL_TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true) + .num_args(1) .value_parser(partial_toolchain_desc_parser), ), ), @@ -583,7 +573,7 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(OFFICIAL_TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true) + .num_args(1) .value_parser(partial_toolchain_desc_parser), ) .arg( @@ -597,36 +587,36 @@ 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(OFFICIAL_TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true) + .num_args(1) .value_parser( partial_toolchain_desc_parser), ) .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(OFFICIAL_TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true) + .num_args(1) .value_parser( partial_toolchain_desc_parser), ) .arg( Arg::new("target") .long("target") - .takes_value(true) + .num_args(1) ), ), ) @@ -647,13 +637,13 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(RESOLVABLE_TOOLCHAIN_ARG_HELP) .required(true) - .takes_value(true) + .num_args(1) .value_parser(resolvable_toolchainame_parser), ) .arg( Arg::new("path") .long("path") - .takes_value(true) + .num_args(1) .help("Path to the directory"), ), ) @@ -665,7 +655,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( @@ -685,14 +675,13 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(RESOLVABLE_LOCAL_TOOLCHAIN_ARG_HELP) .required(true) - .takes_value(true) + .num_args(1) .value_parser(resolvable_local_toolchainame_parser), ) .arg( Arg::new("command") .required(true) - .takes_value(true) - .multiple_values(true) + .num_args(1..) .use_value_delimiter(false), ) .arg( @@ -710,7 +699,7 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(RESOLVABLE_TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true) + .num_args(1) .value_parser(resolvable_toolchainame_parser), ), ) @@ -729,7 +718,7 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(OFFICIAL_TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true) + .num_args(1) .value_parser(partial_toolchain_desc_parser), ) .arg(Arg::new("topic").help(TOPIC_ARG_HELP)) @@ -758,7 +747,7 @@ pub(crate) fn cli() -> Command<'static> { Arg::new("toolchain") .help(OFFICIAL_TOOLCHAIN_ARG_HELP) .long("toolchain") - .takes_value(true) + .num_args(1) .value_parser(partial_toolchain_desc_parser), ), ); @@ -826,7 +815,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,7 +1671,7 @@ impl clap::ValueEnum for CompletionCommand { &[Self::Rustup, Self::Cargo] } - fn to_possible_value<'a>(&self) -> Option> { + fn to_possible_value<'a>(&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 5f22db8e173..39a13687746 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 crate::{ cli::{ @@ -32,8 +32,8 @@ pub fn main() -> Result { // NOTICE: If you change anything here, please make the same changes in rustup-init.sh let cli = Command::new("rustup-init") .version(common::version()) + .before_help(format!("rustup-init {}", common::version())) .about("The installer for rustup") - .setting(AppSettings::DeriveDisplayOrder) .arg( Arg::new("verbose") .short('v') @@ -58,13 +58,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") .value_parser(maybe_official_toolchainame_parser) ) @@ -79,8 +79,7 @@ pub fn main() -> Result { .help("Component name to also install") .long("component") .short('c') - .takes_value(true) - .multiple_values(true) + .num_args(1..) .use_value_delimiter(true) .action(ArgAction::Append), ) @@ -89,8 +88,7 @@ pub fn main() -> Result { .help("Target name to also install") .long("target") .short('t') - .takes_value(true) - .multiple_values(true) + .num_args(1..) .use_value_delimiter(true) .action(ArgAction::Append), ) @@ -110,8 +108,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/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 3aec80655d2..0381c2e7827 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 @@ -3,46 +3,35 @@ 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 +The installer for rustup - -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 """ 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 706f9ec3c67..31b5f06affc 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 @@ -3,46 +3,35 @@ 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 +The installer for rustup - -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 """ 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 793768eb60c..8703a88bc1b 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 @@ -4,10 +4,9 @@ stdout = """ ... Check for updates to Rust toolchains and rustup -USAGE: - rustup[EXE] check +Usage: rustup 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 309ed062fed..4bcad40eaca 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 @@ -4,15 +4,14 @@ stdout = """ ... Generate tab-completion scripts for your shell -USAGE: - rustup[EXE] completions [ARGS] +Usage: rustup 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: Enable tab completion for Bash, Fish, Zsh, or PowerShell @@ -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 2dbd6b2192f..cb3f761acf1 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 @@ -4,16 +4,15 @@ stdout = """ ... Add a component to a Rust toolchain -USAGE: - rustup[EXE] component add [OPTIONS] ... +Usage: rustup 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 221c90dcfa6..12db1e285ce 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 @@ -4,13 +4,12 @@ stdout = """ ... List installed and available components -USAGE: - rustup[EXE] component list [OPTIONS] +Usage: rustup 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 917b72b0418..001aba72d19 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 @@ -4,16 +4,15 @@ stdout = """ ... Remove a component from a Rust toolchain -USAGE: - rustup[EXE] component remove [OPTIONS] ... +Usage: rustup 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 cd47e4f43c7..e23ae8edfd2 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 @@ -4,15 +4,14 @@ stdout = """ ... Set the default toolchain -USAGE: - rustup[EXE] default [toolchain] +Usage: rustup default [toolchain] -ARGS: - 'none', a toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom - toolchain name. For more information see `rustup help toolchain` +Arguments: + [toolchain] 'none', a toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain + name. For more information see `rustup help toolchain` -OPTIONS: - -h, --help Print help information +Options: + -h, --help Print help DISCUSSION: Sets the default toolchain to the one specified. If the toolchain 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 ec12561e41c..9ab1bbab562 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 @@ -4,36 +4,35 @@ stdout = """ ... Open the documentation for the current toolchain -USAGE: - rustup[EXE] doc [OPTIONS] [topic] +Usage: rustup 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: Opens the documentation for the currently active toolchain with 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 68caeb20d77..9c68e85745f 100644 --- a/tests/suite/cli-ui/rustup/rustup_help_cmd_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_help_cmd_stdout.toml @@ -2,38 +2,36 @@ bin.name = "rustup" args = ["help"] status.code = 0 stdout = """ -rustup [..] The Rust toolchain installer -USAGE: - rustup[EXE] [OPTIONS] [+toolchain] +Usage: rustup [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 + 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 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: Rustup installs The Rust Programming Language from the official 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 c0f051e22ae..4e9dc8ea273 100644 --- a/tests/suite/cli-ui/rustup/rustup_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_help_flag_stdout.toml @@ -2,38 +2,36 @@ bin.name = "rustup" args = ["--help"] status.code = 0 stdout = """ -rustup [..] The Rust toolchain installer -USAGE: - rustup[EXE] [OPTIONS] [+toolchain] +Usage: rustup [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 + 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 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: Rustup installs The Rust Programming Language from the official 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 6ec23363969..2444e908604 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 @@ -4,15 +4,14 @@ stdout = """ ... View the man page for a given command -USAGE: - rustup[EXE] man [OPTIONS] +Usage: rustup 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 e7d26004246..93bced10879 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' 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, man, self, set, completions, help] -USAGE: - rustup[EXE] [OPTIONS] [+toolchain] +Usage: rustup [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 95a2e7da31c..24221d632ba 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 @@ -4,15 +4,14 @@ stdout = """ ... Set the override toolchain for a directory -USAGE: - rustup[EXE] override set [OPTIONS] +Usage: rustup override set [OPTIONS] -ARGS: - Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain - name. For more information see `rustup help toolchain` +Arguments: + Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name. 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 08b2daecbdd..3d3878307e8 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 @@ -4,17 +4,16 @@ stdout = """ ... Modify directory toolchain overrides -USAGE: - rustup[EXE] override +Usage: rustup 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: Overrides configure Rustup to use a specific toolchain when 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 8116d717513..ad1d223c0b0 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 @@ -4,10 +4,9 @@ stdout = """ ... List directory toolchain overrides -USAGE: - rustup[EXE] override list +Usage: rustup 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 2bc53d67208..6e99d4873d1 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 @@ -4,13 +4,12 @@ stdout = """ ... Remove the override toolchain for a directory -USAGE: - rustup[EXE] override unset [OPTIONS] +Usage: rustup 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: If `--path` argument is present, removes the override toolchain 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 e8c9ead5c05..988fff53ecb 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 @@ -4,15 +4,14 @@ stdout = """ ... Set the override toolchain for a directory -USAGE: - rustup[EXE] override set [OPTIONS] +Usage: rustup override set [OPTIONS] -ARGS: - Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain - name. For more information see `rustup help toolchain` +Arguments: + Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name. 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 2bc53d67208..6e99d4873d1 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 @@ -4,13 +4,12 @@ stdout = """ ... Remove the override toolchain for a directory -USAGE: - rustup[EXE] override unset [OPTIONS] +Usage: rustup 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: If `--path` argument is present, removes the override toolchain 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 0760ac34656..19fc790e0cc 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 @@ -5,17 +5,16 @@ stdout = """ ... Run a command with an environment configured for a given toolchain -USAGE: - rustup[EXE] run [OPTIONS] ... +Usage: rustup run [OPTIONS] ... -ARGS: - Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain - name, or an absolute path. For more information see `rustup help toolchain` - ... +Arguments: + Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name, or + an absolute path. 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: Configures an environment to use the given toolchain and then runs 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 9c0ff9d9c3f..789b907ede4 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 @@ -4,16 +4,15 @@ stdout = """ ... Modify the rustup installation -USAGE: - rustup[EXE] self +Usage: rustup 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 28628dcd3a4..904c3eae896 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 @@ -4,11 +4,10 @@ stdout = """ ... Uninstall rustup. -USAGE: - rustup[EXE] self uninstall [OPTIONS] +Usage: rustup 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 cbd215987a2..0d052913f55 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 @@ -4,10 +4,9 @@ stdout = """ ... Download and install updates to rustup -USAGE: - rustup[EXE] self update +Usage: rustup 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 c06b9a03f92..84d37f216dc 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 @@ -4,10 +4,9 @@ stdout = """ ... Upgrade the internal data format. -USAGE: - rustup[EXE] self upgrade-data +Usage: rustup 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 0bcce67e6fa..ccd0acff7f6 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 @@ -4,13 +4,12 @@ stdout = """ ... The rustup auto self update mode -USAGE: - rustup[EXE] set auto-self-update +Usage: rustup 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 3b5a9421ad0..e937a3d293a 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 @@ -4,13 +4,12 @@ stdout = """ ... The triple used to identify toolchains when not specified -USAGE: - rustup[EXE] set default-host +Usage: rustup 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 85226561291..29beaf703fe 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 @@ -4,16 +4,15 @@ stdout = """ ... Alter rustup settings -USAGE: - rustup[EXE] set +Usage: rustup 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 7013e214337..e8ec546eb57 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 @@ -4,13 +4,12 @@ stdout = """ ... The default components installed -USAGE: - rustup[EXE] set profile +Usage: rustup 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 0bd8de5fe52..289418fb87f 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 @@ -4,12 +4,11 @@ stdout = """ ... Show the active toolchain -USAGE: - rustup[EXE] show active-toolchain [OPTIONS] +Usage: rustup 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: Shows the name of the active toolchain. 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 fa05eee33ae..6e1cacdb2b9 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 @@ -4,18 +4,17 @@ stdout = """ ... Show the active and installed toolchains or profiles -USAGE: - rustup[EXE] show [OPTIONS] [SUBCOMMAND] +Usage: rustup 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: Shows the name of the active toolchain and the version of `rustc`. 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 a852be10330..be7726689b2 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 @@ -4,10 +4,9 @@ stdout = """ ... Display the computed value of RUSTUP_HOME -USAGE: - rustup[EXE] show home +Usage: rustup 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 32ec3e83474..c19820746b2 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 @@ -4,10 +4,9 @@ stdout = """ ... Show the current profile -USAGE: - rustup[EXE] show profile +Usage: rustup 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 688b6f428ef..641f8f2bb46 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 @@ -4,15 +4,14 @@ stdout = """ ... Add a target to a Rust toolchain -USAGE: - rustup[EXE] target add [OPTIONS] ... +Usage: rustup 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 4872b92191e..f6d014c50ad 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 @@ -4,16 +4,15 @@ stdout = """ ... Modify a toolchain's supported targets -USAGE: - rustup[EXE] target +Usage: rustup 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 07691abfc5c..b8dc62ca53d 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 @@ -4,13 +4,12 @@ stdout = """ ... List installed and available targets -USAGE: - rustup[EXE] target list [OPTIONS] +Usage: rustup 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 60abfefede7..d60e82435af 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 @@ -4,15 +4,14 @@ stdout = """ ... Remove a target from a Rust toolchain -USAGE: - rustup[EXE] target remove [OPTIONS] ... +Usage: rustup 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 a555542b272..3b2822934f3 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 @@ -4,18 +4,17 @@ stdout = """ ... Modify or query the installed toolchains -USAGE: - rustup[EXE] toolchain - -OPTIONS: - -h, --help Print 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 Print this message or the help of the given subcommand(s) +Usage: rustup toolchain + +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) + +Options: + -h, --help Print help DISCUSSION: Many `rustup` commands deal with *toolchains*, a single 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 b3769d1b489..f10b4288b48 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 @@ -4,24 +4,23 @@ stdout = """ ... Install or update a given toolchain -USAGE: - rustup[EXE] toolchain install [OPTIONS] ... +Usage: rustup 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 e931c63ae30..00cc45d6404 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 @@ -4,15 +4,14 @@ stdout = """ ... Create a custom toolchain by symlinking to a directory -USAGE: - rustup[EXE] toolchain link +Usage: rustup 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: 'toolchain' is the custom name to be assigned to the new toolchain. 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 d2592440e91..7fd09192a66 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 @@ -4,11 +4,10 @@ stdout = """ ... List installed toolchains -USAGE: - rustup[EXE] toolchain list [OPTIONS] +Usage: rustup 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 08aa5aac0a6..44c189aab1a 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 @@ -4,14 +4,13 @@ stdout = """ ... Uninstall a toolchain -USAGE: - rustup[EXE] toolchain uninstall ... +Usage: rustup toolchain uninstall ... -ARGS: - ... Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom - toolchain name. For more information see `rustup help toolchain` +Arguments: + ... Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name. + 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 f6e15c12765..aaa03653739 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>': error: \"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]': error: \"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 e60aced4fde..66ac871ab3f 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 @@ -4,19 +4,18 @@ stdout = """ ... Update Rust toolchains and rustup -USAGE: - rustup[EXE] update [OPTIONS] [toolchain]... +Usage: rustup 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: With no toolchain specified, the `update` command updates each of 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 40ffc935f7d..d56deadbed2 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 @@ -4,19 +4,18 @@ stdout = """ ... Update Rust toolchains and rustup -USAGE: - rustup[EXE] update [OPTIONS] [toolchain]... +Usage: rustup 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: With no toolchain specified, the `update` command updates each of 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 2153d7ecbf8..092562ab0be 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 @@ -4,19 +4,18 @@ stdout = """ ... Update Rust toolchains and rustup -USAGE: - rustup[EXE] update [OPTIONS] [toolchain]... +Usage: rustup 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: With no toolchain specified, the `update` command updates each of 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 799e5ae9af7..ca4b04225f8 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 @@ -5,14 +5,13 @@ stdout = """ ... Display which binary will be run for a given command -USAGE: - rustup[EXE] which [OPTIONS] +Usage: rustup which [OPTIONS] -ARGS: - +Arguments: + -OPTIONS: - --toolchain Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom - toolchain name. For more information see `rustup help toolchain` - -h, --help Print help information +Options: + --toolchain Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom + toolchain name. For more information see `rustup help toolchain` + -h, --help Print help """ diff --git a/tests/suite/cli_misc.rs b/tests/suite/cli_misc.rs index 27f5f861521..4aaf5f76beb 100644 --- a/tests/suite/cli_misc.rs +++ b/tests/suite/cli_misc.rs @@ -146,7 +146,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.stdout).unwrap().contains("Usage")); }); } @@ -160,7 +160,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.stdout).unwrap().contains("Usage")); }); } @@ -174,7 +174,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.stdout).unwrap().contains("Usage")); }); } @@ -188,7 +188,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.stdout).unwrap().contains("Usage")); }); } @@ -806,11 +806,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]'"#, ); }); } @@ -820,7 +820,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_self_upd.rs b/tests/suite/cli_self_upd.rs index c21c99abc8e..d67046c183d 100644 --- a/tests/suite/cli_self_upd.rs +++ b/tests/suite/cli_self_upd.rs @@ -359,7 +359,7 @@ fn update_bogus_version() { config.expect_ok(&["rustup-init", "-y", "--no-modify-path"]); config.expect_err( &["rustup", "update", "1.0.0-alpha"], - "Invalid value \"1.0.0-alpha\" for '...': invalid toolchain name: '1.0.0-alpha'", + "invalid value '1.0.0-alpha' for '[toolchain]...': invalid toolchain name: '1.0.0-alpha'", ); }); } diff --git a/tests/suite/cli_ui.rs b/tests/suite/cli_ui.rs index afa8d8831a0..e7ebcd536cc 100644 --- a/tests/suite/cli_ui.rs +++ b/tests/suite/cli_ui.rs @@ -55,6 +55,9 @@ fn rustup_init_ui_doc_text_tests() { .unwrap(); // Make sure that the help output of rustup-init and rustup-init.sh are the same. - assert_eq!(rustup_init_help_std_out, rustup_init_sh_help_std_out) + assert_eq!( + rustup_init_help_std_out.stdout.unwrap(), + rustup_init_sh_help_std_out.stdout.unwrap() + ) } } diff --git a/tests/suite/cli_v2.rs b/tests/suite/cli_v2.rs index 42402980586..e892ac8048b 100644 --- a/tests/suite/cli_v2.rs +++ b/tests/suite/cli_v2.rs @@ -797,7 +797,7 @@ fn cannot_add_empty_named_custom_toolchain() { let path = path.to_string_lossy(); config.expect_err( &["rustup", "toolchain", "link", "", &path], - "Invalid value \"\" for '': invalid toolchain name ''", + "invalid value '' for '': invalid toolchain name ''", ); }); }