diff --git a/slpkg/main.py b/slpkg/main.py index b3461081..e35e3db5 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -42,15 +42,17 @@ class Argparse: '--skip-installed', '--dependees'] + # Check for correct flag for opt in self.args: if opt.startswith('--'): - if opt not in self.options: + if opt not in self.options and opt != '--help': raise SystemExit(f"\nError: flag '{opt}' does not exist.\n") - for option in self.options: - if option in self.args: - self.args.remove(option) - self.flags.append(option) + # Remove flags from args + for opt in self.options: + if opt in self.args: + self.args.remove(opt) + self.flags.append(opt) def help(self): if len(self.args) == 1 and not self.flags: