Skip to content

Commit 44fba34

Browse files
committed
Be more consistent about aliases for different subcommands
In some cases we have the same subcommand in multiple places, but it accepts different aliases in each place. For instance, you can write either `rustup toolchain uninstall` or `rustup toolchain rm`, but you can only write `rustup uninstall`, not `rustup rm`. Add aliases for consistency: - `rustup add` for `rustup install`, for consistency with `rustup toolchain install`. - `rustup rm` (or "remove" or "delete" or "del") for `rustup uninstall`, for consistency with `rustup toolchain uninstall`. - `rustup self up` for `rustup self update`, for consistency with other `update` commands. - `rustup toolchain up` for `rustup toolchain update`, for consistency with other `update` commands.
1 parent 82cecb7 commit 44fba34

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cli/rustup_mode.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ fn plus_toolchain_value_parser(s: &str) -> clap::error::Result<ResolvableToolcha
123123
#[command(name = "rustup", bin_name = "rustup[EXE]")]
124124
enum RustupSubcmd {
125125
/// Install or update the given toolchains, or by default the active toolchain
126-
#[command(hide = true, after_help = install_help())]
126+
#[command(hide = true, after_help = install_help(), aliases = ["add"])]
127127
Install {
128128
#[command(flatten)]
129129
opts: UpdateOpts,
130130
},
131131

132132
/// Uninstall the given toolchains
133-
#[command(hide = true)]
133+
#[command(hide = true, aliases = ["remove", "rm", "delete", "del"])]
134134
Uninstall {
135135
#[command(flatten)]
136136
opts: UninstallOpts,
@@ -332,7 +332,7 @@ enum ToolchainSubcmd {
332332
},
333333

334334
/// Install or update the given toolchains, or by default the active toolchain
335-
#[command(aliases = ["update", "add"], after_help = toolchain_install_help())]
335+
#[command(aliases = ["update", "up", "add"], after_help = toolchain_install_help())]
336336
Install {
337337
#[command(flatten)]
338338
opts: UpdateOpts,
@@ -541,6 +541,7 @@ enum OverrideSubcmd {
541541
)]
542542
enum SelfSubcmd {
543543
/// Download and install updates to rustup
544+
#[command(alias = "up")]
544545
Update,
545546

546547
/// Uninstall rustup

0 commit comments

Comments
 (0)