@@ -158,11 +158,13 @@ pub fn cli() -> App<'static, 'static> {
158
158
. subcommand ( SubCommand :: with_name ( "install" )
159
159
. about ( "Install or update a given toolchain" )
160
160
. arg ( Arg :: with_name ( "toolchain" )
161
- . required ( true ) ) )
161
+ . required ( true )
162
+ . multiple ( true ) ) )
162
163
. subcommand ( SubCommand :: with_name ( "uninstall" )
163
164
. about ( "Uninstall a toolchain" )
164
165
. arg ( Arg :: with_name ( "toolchain" )
165
- . required ( true ) ) )
166
+ . required ( true )
167
+ . multiple ( true ) ) )
166
168
. subcommand ( SubCommand :: with_name ( "link" )
167
169
. about ( "Create a custom toolchain by symlinking to a directory" )
168
170
. arg ( Arg :: with_name ( "toolchain" )
@@ -172,15 +174,18 @@ pub fn cli() -> App<'static, 'static> {
172
174
. subcommand ( SubCommand :: with_name ( "update" )
173
175
. setting ( AppSettings :: Hidden ) // synonym for 'install'
174
176
. arg ( Arg :: with_name ( "toolchain" )
175
- . required ( true ) ) )
177
+ . required ( true )
178
+ . multiple ( true ) ) )
176
179
. subcommand ( SubCommand :: with_name ( "add" )
177
180
. setting ( AppSettings :: Hidden ) // synonym for 'install'
178
181
. arg ( Arg :: with_name ( "toolchain" )
179
- . required ( true ) ) )
182
+ . required ( true )
183
+ . multiple ( true ) ) )
180
184
. subcommand ( SubCommand :: with_name ( "remove" )
181
185
. setting ( AppSettings :: Hidden ) // synonym for 'uninstall'
182
186
. arg ( Arg :: with_name ( "toolchain" )
183
- . required ( true ) ) ) )
187
+ . required ( true )
188
+ . multiple ( true ) ) ) )
184
189
. subcommand ( SubCommand :: with_name ( "target" )
185
190
. about ( "Modify a toolchain's supported targets" )
186
191
. setting ( AppSettings :: VersionlessSubcommands )
@@ -458,21 +463,23 @@ fn default_(cfg: &Cfg, m: &ArgMatches) -> Result<()> {
458
463
}
459
464
460
465
fn update ( cfg : & Cfg , m : & ArgMatches ) -> Result < ( ) > {
461
- if let Some ( name) = m. value_of ( "toolchain" ) {
462
- try!( update_bare_triple_check ( cfg, name) ) ;
463
- let toolchain = try!( cfg. get_toolchain ( name, false ) ) ;
464
-
465
- let status = if !toolchain. is_custom ( ) {
466
- Some ( try!( toolchain. install_from_dist ( ) ) )
467
- } else if !toolchain. exists ( ) {
468
- return Err ( ErrorKind :: ToolchainNotInstalled ( toolchain. name ( ) . to_string ( ) ) . into ( ) ) ;
469
- } else {
470
- None
471
- } ;
466
+ if let Some ( names) = m. values_of ( "toolchain" ) {
467
+ for name in names {
468
+ try!( update_bare_triple_check ( cfg, name) ) ;
469
+ let toolchain = try!( cfg. get_toolchain ( name, false ) ) ;
470
+
471
+ let status = if !toolchain. is_custom ( ) {
472
+ Some ( try!( toolchain. install_from_dist ( ) ) )
473
+ } else if !toolchain. exists ( ) {
474
+ return Err ( ErrorKind :: ToolchainNotInstalled ( toolchain. name ( ) . to_string ( ) ) . into ( ) ) ;
475
+ } else {
476
+ None
477
+ } ;
472
478
473
- if let Some ( status) = status {
474
- println ! ( "" ) ;
475
- try!( common:: show_channel_update ( cfg, toolchain. name ( ) , Ok ( status) ) ) ;
479
+ if let Some ( status) = status {
480
+ println ! ( "" ) ;
481
+ try!( common:: show_channel_update ( cfg, toolchain. name ( ) , Ok ( status) ) ) ;
482
+ }
476
483
}
477
484
} else {
478
485
try!( common:: update_all_channels ( cfg, !m. is_present ( "no-self-update" ) && !self_update:: NEVER_SELF_UPDATE ) ) ;
@@ -684,10 +691,11 @@ fn toolchain_link(cfg: &Cfg, m: &ArgMatches) -> Result<()> {
684
691
}
685
692
686
693
fn toolchain_remove ( cfg : & Cfg , m : & ArgMatches ) -> Result < ( ) > {
687
- let ref toolchain = m. value_of ( "toolchain" ) . expect ( "" ) ;
688
- let toolchain = try!( cfg. get_toolchain ( toolchain, false ) ) ;
689
-
690
- Ok ( try!( toolchain. remove ( ) ) )
694
+ for toolchain in m. values_of ( "toolchain" ) . expect ( "" ) {
695
+ let toolchain = try!( cfg. get_toolchain ( toolchain, false ) ) ;
696
+ try!( toolchain. remove ( ) ) ;
697
+ }
698
+ Ok ( ( ) )
691
699
}
692
700
693
701
fn override_add ( cfg : & Cfg , m : & ArgMatches ) -> Result < ( ) > {
0 commit comments