Added dialog to find command

This commit is contained in:
Dimitris Zlatanidis 2022-12-29 17:42:44 +02:00
parent 9e7402cd8b
commit cfccbf8b71
2 changed files with 13 additions and 4 deletions

View file

@ -86,9 +86,10 @@ class Argparse:
title = f' Choose packages you want to {method} '
repo_packages = SBoQueries('').sbos()
if method == 'remove':
# Grab all the installed packages
installed = os.listdir(self.configs.log_packages)
# Grab all the installed packages
installed = os.listdir(self.configs.log_packages)
if method in ['remove', 'find']:
for package in installed:
name = self.utils.split_installed_pkg(package)[0]
@ -304,9 +305,16 @@ class Argparse:
self.usage.help(1)
def find(self):
if len(self.args) >= 2 and not self.flags:
if [f for f in self.flags if f not in [self.flag_search]]:
self.usage.help(1)
if len(self.args) >= 2:
packages = list(set(self.args[1:]))
if '--search' in self.flags:
packages = self.choose_packages(packages,
Argparse.find.__name__)
self.check.database()
find = FindInstalled()

View file

@ -22,6 +22,7 @@ class Utilities:
pkg = self.split_installed_pkg(package)[0]
if pkg == name and self.configs.sbo_repo_tag in package and pkg not in self.black.get():
return package
return ''
@staticmethod
def untar_archive(path: str, archive: str, ext_path: str):