From ab0f5bb78c60fa8d2e7a9e59ef0ac590a657f6cc Mon Sep 17 00:00:00 2001 From: Matt Harding Date: Thu, 23 Nov 2023 16:34:22 +0000 Subject: [PATCH] Clarify several docs and help messages --- doc/user-guide/src/concepts/profiles.md | 13 ++++++++++--- src/cli/rustup_mode.rs | 6 +++--- .../suite/cli-ui/rustup/rustup_help_cmd_stdout.toml | 2 +- .../cli-ui/rustup/rustup_help_flag_stdout.toml | 2 +- .../cli-ui/rustup/rustup_only_options_stdout.toml | 2 +- .../rustup_override_cmd_help_flag_stdout.toml | 2 +- .../rustup/rustup_set_cmd_help_flag_stdout.toml | 2 +- ...rustup_set_cmd_profile_cmd_help_flag_stdout.toml | 2 +- .../rustup/rustup_show_cmd_help_flag_stdout.toml | 2 +- ...ustup_show_cmd_profile_cmd_help_flag_stdout.toml | 2 +- 10 files changed, 21 insertions(+), 14 deletions(-) diff --git a/doc/user-guide/src/concepts/profiles.md b/doc/user-guide/src/concepts/profiles.md index abb445991f..68b30287c7 100644 --- a/doc/user-guide/src/concepts/profiles.md +++ b/doc/user-guide/src/concepts/profiles.md @@ -20,15 +20,22 @@ available at this time are `minimal`, `default`, and `complete`: install the needed additional components manually, either by using `rustup component add` or by using `-c` when installing the toolchain. -To change the `rustup` profile you can use the `rustup set profile` command. +To change the profile `rustup install` uses by default, you can use the +`rustup set profile` command. For example, to select the minimal profile you can use: ```console rustup set profile minimal ``` -It's also possible to choose the profile when installing `rustup` for the -first time, either interactively by choosing the "Customize installation" +You can also directly select the profile used when installing a toolchain with: + +```console +rustup install --profile +``` + +It's also possible to choose the default profile when installing `rustup` for +the first time, either interactively by choosing the "Customize installation" option or programmatically by passing the `--profile=` flag. Profiles will only affect newly installed toolchains: as usual it will be possible to install individual components later with: `rustup component add`. diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs index 0be87295cb..ae472c7469 100644 --- a/src/cli/rustup_mode.rs +++ b/src/cli/rustup_mode.rs @@ -304,7 +304,7 @@ pub(crate) fn cli() -> Command { Command::new("home") .about("Display the computed value of RUSTUP_HOME"), ) - .subcommand(Command::new("profile").about("Show the current profile")) + .subcommand(Command::new("profile").about("Show the default profile used for the `rustup install` command")) ) .subcommand( Command::new("install") @@ -625,7 +625,7 @@ pub(crate) fn cli() -> Command { ) .subcommand( Command::new("override") - .about("Modify directory toolchain overrides") + .about("Modify toolchain overrides for directories") .after_help(OVERRIDE_HELP) .subcommand_required(true) .arg_required_else_help(true) @@ -784,7 +784,7 @@ pub(crate) fn cli() -> Command { ) .subcommand( Command::new("profile") - .about("The default components installed") + .about("The default components installed with a toolchain") .arg( Arg::new("profile-name") .required(true) 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 791eb0fcf3..eba5f967c7 100644 --- a/tests/suite/cli-ui/rustup/rustup_help_cmd_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_help_cmd_stdout.toml @@ -16,7 +16,7 @@ Commands: 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 + override Modify toolchain overrides for directories 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 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 b93ab136ec..d1b11958f9 100644 --- a/tests/suite/cli-ui/rustup/rustup_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_help_flag_stdout.toml @@ -16,7 +16,7 @@ Commands: 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 + override Modify toolchain overrides for directories 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 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 1b24ddd30a..6eacafa20d 100644 --- a/tests/suite/cli-ui/rustup/rustup_only_options_stdout.toml +++ b/tests/suite/cli-ui/rustup/rustup_only_options_stdout.toml @@ -16,7 +16,7 @@ Commands: 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 + override Modify toolchain overrides for directories 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 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 a9ae2a9f58..27bc0713a4 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 @@ -2,7 +2,7 @@ bin.name = "rustup" args = ["override","--help"] stdout = """ ... -Modify directory toolchain overrides +Modify toolchain overrides for directories Usage: rustup[EXE] override 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 04ce4aaa5a..3d5ffe91f5 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 @@ -8,7 +8,7 @@ Usage: rustup[EXE] set Commands: default-host The triple used to identify toolchains when not specified - profile The default components installed + profile The default components installed with a toolchain auto-self-update The rustup auto self update mode help Print this message or the help of the given subcommand(s) 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 d92d750e17..9ef3527c4e 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 @@ -2,7 +2,7 @@ bin.name = "rustup" args = ["set","profile","--help"] stdout = """ ... -The default components installed +The default components installed with a toolchain Usage: rustup[EXE] set profile 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 b69b13990d..4291fc5a33 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 @@ -9,7 +9,7 @@ Usage: rustup[EXE] show [OPTIONS] [COMMAND] Commands: active-toolchain Show the active toolchain home Display the computed value of RUSTUP_HOME - profile Show the current profile + profile Show the default profile used for the `rustup install` command help Print this message or the help of the given subcommand(s) Options: 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 af20a30cbc..b0449e2670 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 @@ -2,7 +2,7 @@ bin.name = "rustup" args = ["show","profile","--help"] stdout = """ ... -Show the current profile +Show the default profile used for the `rustup install` command Usage: rustup[EXE] show profile