@@ -344,37 +344,33 @@ def print_cli_shortcuts(cmd):
344344 LOGGER .debug ("Failed to display PATH warning" , exc_info = True )
345345 return
346346
347+ from .installs import get_install_alias_names
347348 installs = cmd .get_installs ()
348349 tags = getattr (cmd , "tags" , None )
349350 seen = set ("python.exe" .casefold ())
350351 verbose = LOGGER .would_log_to_console (VERBOSE )
351352 for i in installs :
352- # We only show windowed aliases if -v is enabled. But we log them as
353- # debug info unconditionally. This involves a bit of a dance to keep the
354- # 'windowed' flag around and then drop entries based on whether
355- # LOGGER.verbose would be printed to the console.
356- aliases = sorted ((a ["name" ], a .get ("windowed" , 0 )) for a in i ["alias" ]
357- if a ["name" ].casefold () not in seen )
358- seen .update (n .casefold () for n , * _ in aliases )
353+ # We need to pre-filter aliases before getting the nice names.
354+ aliases = [a for a in i ["alias" ] if a ["name" ].casefold () not in seen ]
355+ seen .update (n ["name" ].casefold () for n in aliases )
359356 if not verbose :
360357 if i .get ("default" ):
361358 LOGGER .debug ("%s will be launched by !G!python.exe!W!" , i ["display-name" ])
362- LOGGER .debug ("%s will be launched by %s" , i ["display-name" ],
363- ", " .join ([n for n , * _ in aliases ]))
364- aliases = [n for n , w in aliases if not w ]
365- else :
366- aliases = [n for n , * _ in aliases ]
359+ names = get_install_alias_names (aliases , windowed = True )
360+ LOGGER .debug ("%s will be launched by %s" , i ["display-name" ], ", " .join (names ))
367361
368362 if tags and not install_matches_any (i , cmd .tags ):
369363 continue
370- if i .get ("default" ) and aliases :
364+
365+ names = get_install_alias_names (aliases , windowed = False )
366+ if i .get ("default" ) and names :
371367 LOGGER .info ("%s will be launched by !G!python.exe!W! and also %s" ,
372- i ["display-name" ], ", " .join (aliases ))
368+ i ["display-name" ], ", " .join (names ))
373369 elif i .get ("default" ):
374370 LOGGER .info ("%s will be launched by !G!python.exe!W!." , i ["display-name" ])
375- elif aliases :
371+ elif names :
376372 LOGGER .info ("%s will be launched by %s" ,
377- i ["display-name" ], ", " .join (aliases ))
373+ i ["display-name" ], ", " .join (names ))
378374 else :
379375 LOGGER .info ("Installed %s to %s" , i ["display-name" ], i ["prefix" ])
380376
0 commit comments