@@ -142,7 +142,7 @@ pub fn main() -> Result<utils::ExitCode> {
142
142
( "home" , Some ( _) ) => handle_epipe ( show_rustup_home ( cfg) ) ?,
143
143
( "profile" , Some ( _) ) => handle_epipe ( show_profile ( cfg) ) ?,
144
144
( "keys" , Some ( _) ) => handle_epipe ( show_keys ( cfg) ) ?,
145
- ( _, _) => handle_epipe ( show ( cfg) ) ?,
145
+ ( _, _) => handle_epipe ( show ( cfg, c ) ) ?,
146
146
} ,
147
147
( "install" , Some ( m) ) => deprecated ( "toolchain install" , cfg, m, update) ?,
148
148
( "update" , Some ( m) ) => update ( cfg, m) ?,
@@ -243,6 +243,9 @@ pub(crate) fn cli() -> App<'static, 'static> {
243
243
SubCommand :: with_name ( "show" )
244
244
. about ( "Show the active and installed toolchains or profiles" )
245
245
. after_help ( SHOW_HELP )
246
+ . arg (
247
+ verbose_arg ( "Enable verbose output with rustc information for all installed toolchains" ) ,
248
+ )
246
249
. setting ( AppSettings :: VersionlessSubcommands )
247
250
. setting ( AppSettings :: DeriveDisplayOrder )
248
251
. subcommand (
@@ -1056,7 +1059,9 @@ fn which(cfg: &Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCode> {
1056
1059
Ok ( utils:: ExitCode ( 0 ) )
1057
1060
}
1058
1061
1059
- fn show ( cfg : & Cfg ) -> Result < utils:: ExitCode > {
1062
+ fn show ( cfg : & Cfg , m : & ArgMatches < ' _ > ) -> Result < utils:: ExitCode > {
1063
+ let verbose = m. is_present ( "verbose" ) ;
1064
+
1060
1065
// Print host triple
1061
1066
{
1062
1067
let mut t = term2:: stdout ( ) ;
@@ -1130,6 +1135,14 @@ fn show(cfg: &Cfg) -> Result<utils::ExitCode> {
1130
1135
} else {
1131
1136
writeln ! ( t, "{}" , it) ?;
1132
1137
}
1138
+ if verbose {
1139
+ if let Ok ( toolchain) = cfg. get_toolchain ( & it, false ) {
1140
+ writeln ! ( process( ) . stdout( ) , "{}" , toolchain. rustc_version( ) ) ?;
1141
+ }
1142
+ // To make it easy to see what rustc that belongs to what
1143
+ // toolchain we separate each pair with an extra newline
1144
+ writeln ! ( process( ) . stdout( ) ) ?;
1145
+ }
1133
1146
}
1134
1147
if show_headers {
1135
1148
writeln ! ( t) ?
0 commit comments