diff --git a/slpkg/main.py b/slpkg/main.py index c3e4512d..887bac54 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -243,18 +243,19 @@ class Argparse(Configs): self.file_pattern = arg.split('=')[1] self.args[self.args.index(arg)] = self.flag_file_pattern - # Fixed for merge options if used, like: -iyjR + # Merge for options, like: -iyjR for args in self.args: if args.startswith('-') and len(args) > 2: self.args.remove(args) - for arg in args[1:]: - if f'-{arg}' in self.commands.keys(): - self.args.append(f'-{arg}') + for arg in list(map(lambda item: f'-{item}', list(args[1:]))): + if arg in self.commands.keys(): + self.args.append(arg) # Put command first and packages seconds. self.args.reverse() continue - self.flags.append(f'-{arg}') + self.flags.append(arg) + # Move options to flags for opt in self.options: if opt in self.args: self.args.remove(opt)