Updated for file pattern

This commit is contained in:
Dimitris Zlatanidis 2023-01-23 21:36:06 +02:00
parent 68f28caaab
commit d21335832a

View file

@ -32,7 +32,7 @@ class Argparse(Configs):
self.args = args
self.flags = []
self.directory = None
self.pattern = None
self.file_pattern = None
self.dialogbox = DialogBox()
self.utils = Utilities()
self.usage = Usage()
@ -80,7 +80,7 @@ class Argparse(Configs):
self.args[self.args.index(arg)] = self.flag_directory
if arg.startswith(self.flag_pattern):
self.pattern = arg.split('=')[1]
self.file_pattern = arg.split('=')[1]
self.args[self.args.index(arg)] = self.flag_pattern
for opt in self.options:
@ -188,7 +188,12 @@ class Argparse(Configs):
repo_packages = SBoQueries('').sbos()
# Grab all the installed packages
installed = self.utils.all_installed(pattern=f'*{self.sbo_repo_tag}')
pattern = f'*{self.sbo_repo_tag}'
if method == 'find' and self.file_pattern:
pattern = self.file_pattern
installed = self.utils.all_installed(pattern)
if method in ['remove', 'find']:
@ -391,7 +396,7 @@ class Argparse(Configs):
self.check.database()
find = FindInstalled()
find.find(packages, self.pattern)
find.find(packages, self.file_pattern)
raise SystemExit()
self.usage.help(1)