diff options
Diffstat (limited to 'mesonlib.py')
-rw-r--r-- | mesonlib.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mesonlib.py b/mesonlib.py index bb69632..99d6154 100644 --- a/mesonlib.py +++ b/mesonlib.py @@ -264,3 +264,21 @@ def stringlistify(item): if not isinstance(i, str): raise MesonException('List item not a string.') return item + +def expand_arguments(args): + expended_args = [] + for arg in args: + if not arg.startswith('@'): + expended_args.append(arg) + continue + + args_file = arg[1:] + try: + with open(args_file) as f: + extended_args = f.read().split() + expended_args += extended_args + except Exception as e: + print('Error expanding command line arguments, %s not found' % args_file) + print(e) + return None + return expended_args |