mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Fixed for IndexError
This commit is contained in:
parent
80e66c1066
commit
ddf61a6a3f
1 changed files with 20 additions and 5 deletions
|
@ -285,7 +285,14 @@ class Argparse(Configs):
|
||||||
""" Checks combination for binaries use repositories only and if repository exists. """
|
""" Checks combination for binaries use repositories only and if repository exists. """
|
||||||
if self.utils.is_option(self.flag_binaries, self.flags):
|
if self.utils.is_option(self.flag_binaries, self.flags):
|
||||||
|
|
||||||
except_options: list = ['-s', 'search', '-u', 'update', '-c', 'check-updates']
|
except_options: list = [
|
||||||
|
'-s', 'search',
|
||||||
|
'-u', 'update',
|
||||||
|
'-c', 'check-updates',
|
||||||
|
'-t', 'tracking',
|
||||||
|
'-e', 'dependees',
|
||||||
|
'-w', 'view'
|
||||||
|
]
|
||||||
|
|
||||||
if self.binary_repo == '*' and not self.utils.is_option(except_options, self.args):
|
if self.binary_repo == '*' and not self.utils.is_option(except_options, self.args):
|
||||||
self.usage.help_minimal(f"{self.prog_name}: invalid binary repository '{self.binary_repo}'")
|
self.usage.help_minimal(f"{self.prog_name}: invalid binary repository '{self.binary_repo}'")
|
||||||
|
@ -361,7 +368,11 @@ class Argparse(Configs):
|
||||||
self.args[self.args.index(arg)] = self.flag_directory
|
self.args[self.args.index(arg)] = self.flag_directory
|
||||||
|
|
||||||
if arg.startswith(self.flag_short_directory) and len(self.args) > 3:
|
if arg.startswith(self.flag_short_directory) and len(self.args) > 3:
|
||||||
|
try:
|
||||||
self.directory: str = self.args[self.args.index(arg) + 1]
|
self.directory: str = self.args[self.args.index(arg) + 1]
|
||||||
|
except IndexError:
|
||||||
|
self.directory: Path = self.tmp_slpkg
|
||||||
|
else:
|
||||||
self.args.remove(self.directory)
|
self.args.remove(self.directory)
|
||||||
|
|
||||||
if arg.startswith(self.flag_bin_repository):
|
if arg.startswith(self.flag_bin_repository):
|
||||||
|
@ -369,7 +380,11 @@ class Argparse(Configs):
|
||||||
self.args[self.args.index(arg)] = self.flag_bin_repository
|
self.args[self.args.index(arg)] = self.flag_bin_repository
|
||||||
|
|
||||||
if arg.startswith(self.flag_short_bin_repository) and len(self.args) > 2:
|
if arg.startswith(self.flag_short_bin_repository) and len(self.args) > 2:
|
||||||
|
try:
|
||||||
self.binary_repo: str = self.args[self.args.index(arg) + 1]
|
self.binary_repo: str = self.args[self.args.index(arg) + 1]
|
||||||
|
except IndexError:
|
||||||
|
self.binary_repo: str = ''
|
||||||
|
else:
|
||||||
self.args.remove(self.binary_repo)
|
self.args.remove(self.binary_repo)
|
||||||
|
|
||||||
def move_options(self) -> None:
|
def move_options(self) -> None:
|
||||||
|
|
Loading…
Add table
Reference in a new issue