Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions src/cli/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ pub(crate) fn update_help() -> String {
updates rustup itself.

If given a toolchain argument then `update` updates that
toolchain, the same as `rustup toolchain install`."
toolchain, the same as `rustup toolchain install`.

{TOOLCHAIN_INSTALL_HINT}"
)
}

pub(crate) fn install_help() -> String {
format!(
r"{HEADER}Discussion:{HEADER:#}
Installs a specific rust toolchain.

The 'install' command is an alias for 'rustup update <toolchain>'."
The 'install' command is an alias for 'rustup toolchain install'."
)
}

Expand Down Expand Up @@ -118,6 +118,13 @@ pub(crate) fn toolchain_help() -> String {
)
}

pub(crate) fn toolchain_install_help() -> String {
format!(
r"{HEADER}Discussion:{HEADER:#}
{TOOLCHAIN_INSTALL_HINT}"
)
}

pub(crate) fn toolchain_link_help() -> String {
format!(
r"{HEADER}Discussion:{HEADER:#}
Expand Down Expand Up @@ -362,3 +369,13 @@ pub(crate) fn topic_arg_help() -> &'static str {
}

const SUBHEADER: Style = Style::new().bold();

const TOOLCHAIN_INSTALL_HINT: &str =
" Some environment variables allow you to customize certain parameters
in toolchain installation, including:

- `RUSTUP_CONCURRENT_DOWNLOADS`: the number of concurrent downloads.
- `RUSTUP_DOWNLOAD_TIMEOUT`: the download timeout in seconds.

See <https://rust-lang.github.io/rustup/devel/environment-variables.html>
for more info.";
5 changes: 3 additions & 2 deletions src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ use crate::{
maybe_resolvable_toolchain_arg_help, official_toolchain_arg_help, override_help,
override_unset_help, resolvable_local_toolchain_arg_help,
resolvable_toolchain_arg_help, run_help, rustup_help, show_active_toolchain_help,
show_help, toolchain_help, toolchain_link_help, topic_arg_help, update_help,
show_help, toolchain_help, toolchain_install_help, toolchain_link_help, topic_arg_help,
update_help,
},
self_update::{self, SelfUpdateMode, check_rustup_update},
topical_doc,
Expand Down Expand Up @@ -331,7 +332,7 @@ enum ToolchainSubcmd {
},

/// Install or update the given toolchains, or by default the active toolchain
#[command(aliases = ["update", "add"] )]
#[command(aliases = ["update", "add"], after_help = toolchain_install_help())]
Install {
#[command(flatten)]
opts: UpdateOpts,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.