@@ -123,14 +123,14 @@ fn plus_toolchain_value_parser(s: &str) -> clap::error::Result<ResolvableToolcha
123123#[ command( name = "rustup" , bin_name = "rustup[EXE]" ) ]
124124enum RustupSubcmd {
125125 /// Install or update the given toolchains, or by default the active toolchain
126- #[ command( hide = true , after_help = install_help ( ) ) ]
126+ #[ command( 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( 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 ,
@@ -386,6 +386,10 @@ struct UpdateOpts {
386386 #[ arg( long) ]
387387 no_self_update : bool ,
388388
389+ /// Don't try to update the installed toolchain
390+ #[ arg( long) ]
391+ no_update : bool ,
392+
389393 /// Force an update, even if some components are missing
390394 #[ arg( long) ]
391395 force : bool ,
@@ -537,6 +541,7 @@ enum OverrideSubcmd {
537541) ]
538542enum SelfSubcmd {
539543 /// Download and install updates to rustup
544+ #[ command( alias = "up" ) ]
540545 Update ,
541546
542547 /// Uninstall rustup
@@ -971,9 +976,13 @@ async fn update(
971976
972977 let status = match DistributableToolchain :: new ( cfg, desc. clone ( ) ) {
973978 Ok ( d) => {
974- InstallMethod :: Dist ( dist_opts. for_update ( & d, opts. allow_downgrade ) )
975- . install ( )
976- . await ?
979+ if !opts. no_update {
980+ InstallMethod :: Dist ( dist_opts. for_update ( & d, opts. allow_downgrade ) )
981+ . install ( )
982+ . await ?
983+ } else {
984+ UpdateStatus :: Unchanged
985+ }
977986 }
978987 Err ( RustupError :: ToolchainNotInstalled { .. } ) => {
979988 DistributableToolchain :: install ( dist_opts) . await ?. 0
0 commit comments