File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -572,7 +572,14 @@ impl RefactorState {
572572 s
573573 } ) ) ;
574574
575- let mut cmd = self . cmd_reg . get_command ( cmd_name, & args) ?;
575+ let mut cmd = self . cmd_reg . get_command ( cmd_name, & args) . map_err ( |mut e| {
576+ e. push_str ( "\n Valid commands:" ) ;
577+ for c in self . cmd_reg . commands . keys ( ) {
578+ e. push_str ( "\n \t " ) ;
579+ e. push_str ( c) ;
580+ }
581+ e
582+ } ) ?;
576583 profile_start ! ( format!( "Command {}" , cmd_name) ) ;
577584 cmd. run ( self ) ;
578585 profile_end ! ( format!( "Command {}" , cmd_name) ) ;
Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ impl InteractState {
194194 match self . state . run ( & name, & args) {
195195 Ok ( _) => { }
196196 Err ( e) => {
197- eprintln ! ( "{:?}" , e ) ;
197+ eprintln ! ( "{e}" ) ;
198198 panic ! ( "Invalid command." ) ;
199199 }
200200 }
Original file line number Diff line number Diff line change @@ -487,7 +487,7 @@ fn main_impl(opts: Options) -> interface::Result<()> {
487487 match state. run ( & cmd. name , & cmd. args ) {
488488 Ok ( _) => { }
489489 Err ( e) => {
490- eprintln ! ( "{:?}" , e ) ;
490+ eprintln ! ( "{e}" ) ;
491491 std:: process:: exit ( 1 ) ;
492492 }
493493 }
You can’t perform that action at this time.
0 commit comments