mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-13 20:01:48 +01:00
Updated for merge options
This commit is contained in:
parent
ffdc974741
commit
453093d325
1 changed files with 6 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue