Updated for split options

This commit is contained in:
Dimitris Zlatanidis 2023-02-26 20:26:36 +02:00
parent dd22cfb0f1
commit 5832be34ab

View file

@ -229,9 +229,7 @@ class Argparse(Configs):
def split_options(self):
""" Split options and commands, like: -iyjR """
for args in self.args:
if (args[0] == '-' and args[:2] != '--' and len(args) >= 3 and
not args.startswith((self.flag_short_file_pattern,
self.flag_short_directory))):
if args[0] == '-' and args[:2] != '--' and len(args) >= 3 and '=' not in args:
self.args.remove(args)
for opt in list(map(lambda item: f'-{item}', [arg for arg in list(args[1:])])):
@ -240,6 +238,7 @@ class Argparse(Configs):
continue
self.args.append(opt)
print(self.args)
def split_options_from_args(self):
""" Split options from arguments. """