File tree 1 file changed +15
-9
lines changed
1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -1376,15 +1376,21 @@ pub fn get_alias_candidates() -> Vec<clap_complete::CompletionCandidate> {
1376
1376
return alias_map
1377
1377
. iter ( )
1378
1378
. map ( |( alias, cmd_info) | {
1379
- let help_text = if let CommandInfo :: Alias { target } = cmd_info {
1380
- let cmd_str = target
1381
- . iter ( )
1382
- . map ( String :: as_str)
1383
- . collect :: < Vec < _ > > ( )
1384
- . join ( " " ) ;
1385
- format ! ( "alias for {}" , cmd_str)
1386
- } else {
1387
- "alias (from config)" . to_string ( )
1379
+ let help_text = match cmd_info {
1380
+ CommandInfo :: Alias { target } => {
1381
+ let cmd_str = target
1382
+ . iter ( )
1383
+ . map ( String :: as_str)
1384
+ . collect :: < Vec < _ > > ( )
1385
+ . join ( " " ) ;
1386
+ format ! ( "alias for {}" , cmd_str)
1387
+ }
1388
+ CommandInfo :: BuiltIn { .. } => {
1389
+ unreachable ! ( "BuiltIn command shouldn't appear in alias map" )
1390
+ }
1391
+ CommandInfo :: External { .. } => {
1392
+ unreachable ! ( "External command shouldn't appear in alias map" )
1393
+ }
1388
1394
} ;
1389
1395
clap_complete:: CompletionCandidate :: new ( alias. clone ( ) ) . help ( Some ( help_text. into ( ) ) )
1390
1396
} )
You can’t perform that action at this time.
0 commit comments