Skip to content

Commit a9fb1ca

Browse files
committed
feat(cli/help): discuss rustup toolchain install
1 parent 2dc6dd7 commit a9fb1ca

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

src/cli/help.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,20 @@ pub(crate) fn toolchain_help() -> String {
118118
)
119119
}
120120

121+
pub(crate) fn toolchain_install_help() -> String {
122+
format!(
123+
r"{HEADER}Discussion:{HEADER:#}
124+
Some environment variables allow you to customize certain parameters
125+
in toolchain installation, including:
126+
127+
- `RUSTUP_CONCURRENT_DOWNLOADS`: The number of concurrent downloads.
128+
- `RUSTUP_DOWNLOAD_TIMEOUT`: The download timeout in seconds.
129+
130+
See <https://rust-lang.github.io/rustup/devel/environment-variables.html>
131+
for more info."
132+
)
133+
}
134+
121135
pub(crate) fn toolchain_link_help() -> String {
122136
format!(
123137
r"{HEADER}Discussion:{HEADER:#}

src/cli/rustup_mode.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ use crate::{
3232
maybe_resolvable_toolchain_arg_help, official_toolchain_arg_help, override_help,
3333
override_unset_help, resolvable_local_toolchain_arg_help,
3434
resolvable_toolchain_arg_help, run_help, rustup_help, show_active_toolchain_help,
35-
show_help, toolchain_help, toolchain_link_help, topic_arg_help, update_help,
35+
show_help, toolchain_help, toolchain_install_help, toolchain_link_help, topic_arg_help,
36+
update_help,
3637
},
3738
self_update::{self, SelfUpdateMode, check_rustup_update},
3839
topical_doc,
@@ -331,7 +332,7 @@ enum ToolchainSubcmd {
331332
},
332333

333334
/// Install or update the given toolchains, or by default the active toolchain
334-
#[command(aliases = ["update", "add"] )]
335+
#[command(aliases = ["update", "add"], after_help = toolchain_install_help())]
335336
Install {
336337
#[command(flatten)]
337338
opts: UpdateOpts,

tests/suite/cli_rustup_ui/rustup_toolchain_cmd_install_cmd_help_flag.stdout.term.svg

Lines changed: 21 additions & 1 deletion
Loading

0 commit comments

Comments
 (0)