@@ -131,7 +131,7 @@ pub fn main() -> Result<utils::ExitCode> {
131
131
Ok ( match matches. subcommand ( ) {
132
132
( "dump-testament" , _) => common:: dump_testament ( ) ?,
133
133
( "show" , Some ( c) ) => match c. subcommand ( ) {
134
- ( "active-toolchain" , Some ( _ ) ) => handle_epipe ( show_active_toolchain ( cfg) ) ?,
134
+ ( "active-toolchain" , Some ( m ) ) => handle_epipe ( show_active_toolchain ( cfg, m ) ) ?,
135
135
( "home" , Some ( _) ) => handle_epipe ( show_rustup_home ( cfg) ) ?,
136
136
( "profile" , Some ( _) ) => handle_epipe ( show_profile ( cfg) ) ?,
137
137
( "keys" , Some ( _) ) => handle_epipe ( show_keys ( cfg) ) ?,
@@ -243,7 +243,14 @@ pub fn cli() -> App<'static, 'static> {
243
243
. subcommand (
244
244
SubCommand :: with_name ( "active-toolchain" )
245
245
. about ( "Show the active toolchain" )
246
- . after_help ( SHOW_ACTIVE_TOOLCHAIN_HELP ) ,
246
+ . after_help ( SHOW_ACTIVE_TOOLCHAIN_HELP )
247
+ . arg (
248
+ Arg :: with_name ( "verbose" )
249
+ . help ( "Enable verbose output with rustc information" )
250
+ . takes_value ( false )
251
+ . short ( "v" )
252
+ . long ( "verbose" ) ,
253
+ ) ,
247
254
)
248
255
. subcommand (
249
256
SubCommand :: with_name ( "home" )
@@ -1182,7 +1189,8 @@ fn show(cfg: &Cfg) -> Result<utils::ExitCode> {
1182
1189
Ok ( utils:: ExitCode ( 0 ) )
1183
1190
}
1184
1191
1185
- fn show_active_toolchain ( cfg : & Cfg ) -> Result < utils:: ExitCode > {
1192
+ fn show_active_toolchain ( cfg : & Cfg , m : & ArgMatches < ' _ > ) -> Result < utils:: ExitCode > {
1193
+ let verbose = m. is_present ( "verbose" ) ;
1186
1194
let cwd = utils:: current_dir ( ) ?;
1187
1195
match cfg. find_or_install_override_toolchain_or_default ( & cwd) {
1188
1196
Err ( crate :: Error ( crate :: ErrorKind :: ToolchainNotSelected , _) ) => { }
@@ -1193,6 +1201,9 @@ fn show_active_toolchain(cfg: &Cfg) -> Result<utils::ExitCode> {
1193
1201
} else {
1194
1202
writeln ! ( process( ) . stdout( ) , "{} (default)" , toolchain. name( ) ) ?;
1195
1203
}
1204
+ if verbose {
1205
+ writeln ! ( process( ) . stdout( ) , "{}" , toolchain. rustc_version( ) ) ?;
1206
+ }
1196
1207
}
1197
1208
}
1198
1209
Ok ( utils:: ExitCode ( 0 ) )
0 commit comments