Skip to content

Tweak rustup help output #4272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 30, 2025
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
34 changes: 17 additions & 17 deletions src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,23 @@ enum RustupSubcmd {
#[command(hide = true)]
DumpTestament,

/// Install, uninstall, or list toolchains
Toolchain {
#[command(subcommand)]
subcmd: ToolchainSubcmd,
},

/// Set the default toolchain
#[command(after_help = DEFAULT_HELP)]
Default {
#[arg(help = MAYBE_RESOLVABLE_TOOLCHAIN_ARG_HELP)]
toolchain: Option<MaybeResolvableToolchainName>,

/// Install toolchains that require an emulator. See https://github.com/rust-lang/rustup/wiki/Non-host-toolchains
#[arg(long)]
force_non_host: bool,
},

/// Show the active and installed toolchains or profiles
#[command(after_help = SHOW_HELP)]
Show {
Expand Down Expand Up @@ -162,23 +179,6 @@ enum RustupSubcmd {
/// Check for updates to Rust toolchains and rustup
Check,

/// Set the default toolchain
#[command(after_help = DEFAULT_HELP)]
Default {
#[arg(help = MAYBE_RESOLVABLE_TOOLCHAIN_ARG_HELP)]
toolchain: Option<MaybeResolvableToolchainName>,

/// Install toolchains that require an emulator. See https://github.com/rust-lang/rustup/wiki/Non-host-toolchains
#[arg(long)]
force_non_host: bool,
},

/// Modify or query the installed toolchains
Toolchain {
#[command(subcommand)]
subcmd: ToolchainSubcmd,
},

/// Modify a toolchain's supported targets
Target {
#[command(subcommand)]
Expand Down
4 changes: 2 additions & 2 deletions tests/suite/cli-ui/rustup/rustup_help_cmd_stdout.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ The Rust toolchain installer
Usage: rustup[EXE] [OPTIONS] [+toolchain] [COMMAND]

Commands:
toolchain Install, uninstall, or list toolchains
default Set the default toolchain
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 toolchain overrides for directories
Expand Down
4 changes: 2 additions & 2 deletions tests/suite/cli-ui/rustup/rustup_help_flag_stdout.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ The Rust toolchain installer
Usage: rustup[EXE] [OPTIONS] [+toolchain] [COMMAND]

Commands:
toolchain Install, uninstall, or list toolchains
default Set the default toolchain
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 toolchain overrides for directories
Expand Down
4 changes: 2 additions & 2 deletions tests/suite/cli-ui/rustup/rustup_only_options_stdout.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ The Rust toolchain installer
Usage: rustup[EXE] [OPTIONS] [+toolchain] [COMMAND]

Commands:
toolchain Install, uninstall, or list toolchains
default Set the default toolchain
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 toolchain overrides for directories
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ bin.name = "rustup"
args = ["toolchain", "--help"]
stdout = """
...
Modify or query the installed toolchains
Install, uninstall, or list toolchains

Usage: rustup[EXE] toolchain <COMMAND>

Expand Down