@@ -131,7 +131,7 @@ pub fn main() -> Result<utils::ExitCode> {
131131 Ok ( match matches. subcommand ( ) {
132132 ( "dump-testament" , _) => common:: dump_testament ( ) ?,
133133 ( "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 ) ) ?,
135135 ( "home" , Some ( _) ) => handle_epipe ( show_rustup_home ( cfg) ) ?,
136136 ( "profile" , Some ( _) ) => handle_epipe ( show_profile ( cfg) ) ?,
137137 ( "keys" , Some ( _) ) => handle_epipe ( show_keys ( cfg) ) ?,
@@ -243,7 +243,14 @@ pub fn cli() -> App<'static, 'static> {
243243 . subcommand (
244244 SubCommand :: with_name ( "active-toolchain" )
245245 . 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+ ) ,
247254 )
248255 . subcommand (
249256 SubCommand :: with_name ( "home" )
@@ -1182,7 +1189,8 @@ fn show(cfg: &Cfg) -> Result<utils::ExitCode> {
11821189 Ok ( utils:: ExitCode ( 0 ) )
11831190}
11841191
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" ) ;
11861194 let cwd = utils:: current_dir ( ) ?;
11871195 match cfg. find_or_install_override_toolchain_or_default ( & cwd) {
11881196 Err ( crate :: Error ( crate :: ErrorKind :: ToolchainNotSelected , _) ) => { }
@@ -1193,6 +1201,9 @@ fn show_active_toolchain(cfg: &Cfg) -> Result<utils::ExitCode> {
11931201 } else {
11941202 writeln ! ( process( ) . stdout( ) , "{} (default)" , toolchain. name( ) ) ?;
11951203 }
1204+ if verbose {
1205+ writeln ! ( process( ) . stdout( ) , "{}" , toolchain. rustc_version( ) ) ?;
1206+ }
11961207 }
11971208 }
11981209 Ok ( utils:: ExitCode ( 0 ) )
0 commit comments