option to show installed packages in search

This commit is contained in:
2026-06-20 17:27:43 +10:00
parent fd8aa149ca
commit a3cafef15f

View File

@@ -1,4 +1,4 @@
from .util import get_package_index
from .util import get_package_index, installed_libs
from .console import console
from rich.table import Table
@@ -7,8 +7,9 @@ from rich.box import ROUNDED
def search(args):
index = get_package_index()
installed = installed_libs()
matching_keys = [key for key in index if args.query in key]
matching_keys = [key for key in index if args.query in key and not (not args.show_installed and key in installed)]
if args.limit >= 0:
matching_keys = matching_keys[:args.limit]