Fixed check bin repos

This commit is contained in:
Dimitris Zlatanidis 2023-03-30 10:48:07 +03:00
parent 01d07a68f5
commit c1d877bab7

View file

@ -283,13 +283,13 @@ class Argparse(Configs):
def check_for_bin_repositories(self) -> None:
""" Checks combination for binaries use repositories only and if repository exists. """
if (self.utils.is_option(self.flag_binaries, self.flags)
and not self.utils.is_option(self.flag_binaries, self.flags)):
self.usage.help_minimal(f"{self.prog_name}: invalid options '{', '.join(self.flags)}'")
if self.utils.is_option(self.flag_binaries, self.flags):
if self.binary_repo not in self.repos.binaries_repositories_dict.keys() \
and self.binary_repo == '*' and not self.utils.is_option(['-s', 'search', '-u', 'update'], self.args):
self.usage.help_minimal(f"{self.prog_name}: invalid binary repository '{self.binary_repo}'")
if self.binary_repo == '*' and not self.utils.is_option(['-s', 'search', '-u', 'update'], self.args):
self.usage.help_minimal(f"{self.prog_name}: invalid binary repository '{self.binary_repo}'")
elif self.binary_repo not in self.repos.binaries_repositories_dict.keys() and self.binary_repo != '*':
self.usage.help_minimal(f"{self.prog_name}: invalid binary repository '{self.binary_repo}'")
def invalid_options(self) -> None:
""" Checks for invalid options. """