Skip to content

Commit d7280c8

Browse files
committed
feat(cli/help): discuss rustup toolchain install
1 parent c5839b9 commit d7280c8

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ enum ToolchainSubcmd {
325325
},
326326

327327
/// Install or update the given toolchains, or by default the active toolchain
328-
#[command(aliases = ["update", "add"] )]
328+
#[command(aliases = ["update", "add"], after_help = toolchain_install_help())]
329329
Install {
330330
#[command(flatten)]
331331
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)