option to show installed packages in search
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user