Fixed for invalid commands

This commit is contained in:
Dimitris Zlatanidis 2023-03-17 09:58:38 +02:00
parent da3320290c
commit 29e6b4f08b

View file

@ -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: