configure --set support list as arguments
This commit is contained in:
parent
8763965a2c
commit
89566d5a9b
@ -182,6 +182,11 @@ def err(msg):
|
|||||||
print("configure: error: " + msg)
|
print("configure: error: " + msg)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
def is_value_list(key):
|
||||||
|
for option in options:
|
||||||
|
if option.name == key and option.desc.startswith('List of'):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
if '--help' in sys.argv or '-h' in sys.argv:
|
if '--help' in sys.argv or '-h' in sys.argv:
|
||||||
print('Usage: ./configure [options]')
|
print('Usage: ./configure [options]')
|
||||||
@ -295,6 +300,8 @@ def set(key, value, config):
|
|||||||
parts = key.split('.')
|
parts = key.split('.')
|
||||||
for i, part in enumerate(parts):
|
for i, part in enumerate(parts):
|
||||||
if i == len(parts) - 1:
|
if i == len(parts) - 1:
|
||||||
|
if is_value_list(part):
|
||||||
|
value = value.split(',')
|
||||||
arr[part] = value
|
arr[part] = value
|
||||||
else:
|
else:
|
||||||
if part not in arr:
|
if part not in arr:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user