mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +01:00
Fixed for doubles options
This commit is contained in:
parent
7000139f9f
commit
97698c5631
1 changed files with 9 additions and 0 deletions
|
@ -270,6 +270,7 @@ class Argparse(Configs):
|
|||
""" Checks for invalid options. """
|
||||
invalid: list = []
|
||||
commands: list = []
|
||||
doubles: list = []
|
||||
|
||||
for arg in self.args:
|
||||
if arg[0] == '-' and arg in self.commands.keys():
|
||||
|
@ -278,6 +279,14 @@ class Argparse(Configs):
|
|||
invalid.append(arg)
|
||||
elif arg[0] == '--' and arg not in self.options:
|
||||
invalid.append(arg)
|
||||
elif arg[0] == '-' and arg in self.options:
|
||||
doubles.append(arg)
|
||||
|
||||
# Fixed for doubles options.
|
||||
if doubles:
|
||||
for opt in doubles:
|
||||
print(f"{self.prog_name}: invalid double option '{opt}'")
|
||||
self.usage.help_minimal()
|
||||
|
||||
# Fixed for invalid commands combination.
|
||||
if len(commands) > 1:
|
||||
|
|
Loading…
Reference in a new issue