From b52aa6733b51e861f880b72509b541f3dcceb5a7 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 4 Apr 2023 18:58:35 +0300 Subject: [PATCH] Fixed for binary repo --- slpkg/main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/slpkg/main.py b/slpkg/main.py index 5f5c44c3..a5d13578 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -52,7 +52,7 @@ class Argparse(Configs): self.red: str = self.color['red'] self.endc: str = self.color['endc'] self.bred: str = f'{self.bold}{self.red}' - self.binary_repo = None + self.binary_repo: str = '' if len(self.args) == 0 or '' in self.args: self.usage.help_short(1) @@ -277,10 +277,10 @@ class Argparse(Configs): self.split_options_from_args() self.move_options() self.invalid_options() + self.check_for_bin_repositories() self.check = Check(self.flags) self.check.is_blacklist(self.args[1:]) - self.check_for_bin_repositories() def check_for_bin_repositories(self) -> None: """ Checks combination for binaries use repositories only and if repository exists. """ @@ -381,10 +381,13 @@ class Argparse(Configs): try: self.binary_repo: str = self.args[self.args.index(arg) + 1] except IndexError: - self.binary_repo: str = '' + self.binary_repo = '' else: self.args.remove(self.binary_repo) + if self.binary_repo in self.options: + self.binary_repo: str = '' + def move_options(self) -> None: """ Move options to the flags and removes from the arguments. """ new_args: list = []