mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-29 20:34:22 +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):
|
||||
""" Checks for invalid options. """
|
||||
invalid: list = []
|
||||
command: list = []
|
||||
|
||||
for arg in self.args:
|
||||
if arg in self.commands.keys():
|
||||
pass
|
||||
if arg[0] == '-' and arg in self.commands.keys():
|
||||
command.append(arg)
|
||||
elif arg[0] == '-' and arg not in self.options:
|
||||
invalid.append(arg)
|
||||
elif arg[0] == '--' and arg not in self.options:
|
||||
invalid.append(arg)
|
||||
|
||||
# Fixed for two or more commands.
|
||||
if len(command) > 1:
|
||||
invalid = command
|
||||
|
||||
# Prints error for invalid options.
|
||||
if invalid:
|
||||
for opt in invalid:
|
||||
|
|
Loading…
Add table
Reference in a new issue