提交 4c6458d7 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Accept options specified more than 2 arguments

like -option val1 val2
上级 832fbd75
...@@ -1638,16 +1638,16 @@ class GCC_compiler(object): ...@@ -1638,16 +1638,16 @@ class GCC_compiler(object):
# joined with the previous one. # joined with the previous one.
def join_options(init_part): def join_options(init_part):
new_part = [] new_part = []
for i, p in enumerate(init_part): for i in range(len(init_part)):
p = init_part[i]
if p.startswith('-'): if p.startswith('-'):
if ((i + 1 < len(init_part)) and p_list = [p]
while ((i + 1 < len(init_part)) and
not init_part[i + 1].startswith('-')): not init_part[i + 1].startswith('-')):
# add "-option value" as one arg # append that next part to p_list
pp1 = init_part[i + 1] p_list.append(init_part[i + 1])
new_part.append(' '.join((p, pp1))) i += 1
else: new_part.append(' '.join(p_list))
# add "-option" as one arg
new_part.append(p)
elif i == 0: elif i == 0:
# The first argument does not usually start # The first argument does not usually start
# with "-", still add it # with "-", still add it
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论