From 34262069422a482d4c15ec80c453e328fc62175f Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 30 Mar 2023 22:57:17 +0300 Subject: [PATCH] Fixed for keyerror --- slpkg/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/slpkg/main.py b/slpkg/main.py index efe002f9..02daf377 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -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)