mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Fixed for invalid commands
This commit is contained in:
parent
da3320290c
commit
29e6b4f08b
1 changed files with 7 additions and 2 deletions
|
@ -269,15 +269,20 @@ class Argparse(Configs):
|
||||||
def invalid_options(self):
|
def invalid_options(self):
|
||||||
""" Checks for invalid options. """
|
""" Checks for invalid options. """
|
||||||
invalid: list = []
|
invalid: list = []
|
||||||
|
command: list = []
|
||||||
|
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
if arg in self.commands.keys():
|
if arg[0] == '-' and arg in self.commands.keys():
|
||||||
pass
|
command.append(arg)
|
||||||
elif arg[0] == '-' and arg not in self.options:
|
elif arg[0] == '-' and arg not in self.options:
|
||||||
invalid.append(arg)
|
invalid.append(arg)
|
||||||
elif arg[0] == '--' and arg not in self.options:
|
elif arg[0] == '--' and arg not in self.options:
|
||||||
invalid.append(arg)
|
invalid.append(arg)
|
||||||
|
|
||||||
|
# Fixed for two or more commands.
|
||||||
|
if len(command) > 1:
|
||||||
|
invalid = command
|
||||||
|
|
||||||
# Prints error for invalid options.
|
# Prints error for invalid options.
|
||||||
if invalid:
|
if invalid:
|
||||||
for opt in invalid:
|
for opt in invalid:
|
||||||
|
|
Loading…
Add table
Reference in a new issue