Fixed for keyerror

This commit is contained in:
Dimitris Zlatanidis 2023-03-30 22:57:17 +03:00
parent b97424c835
commit 3426206942

View file

@ -729,8 +729,11 @@ class Argparse(Configs):
def help_for_commands(self) -> None:
""" Extra help information for commands. """
if len(self.args) == 2:
flags = self.commands[self.args[1]]
Help(self.args[1], flags).view()
try:
flags = self.commands[self.args[1]]
Help(self.args[1], flags).view()
except KeyError:
self.usage.help_short(1)
else:
self.usage.help_short(1)