Commit e8cea8c8 authored by Nikolaos Papaspyrou's avatar Nikolaos Papaspyrou Committed by V8 LUCI CQ

[tools][gm] Fix aliases for modes with a suffix

Minor bug fix in alias support (crrev.com/c/3723506), which broke
modes with suffixes, e.g. x64.release-css or x64.rel-css

No-Try: True
Change-Id: I16fdc83dde269f66f4bb7260de0d2649aaece27e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3732929
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81541}
parent 16b58424
......@@ -484,11 +484,16 @@ class ArgumentParser(object):
targets.append(word)
elif word in ACTIONS:
actions.append(word)
elif any(word.startswith(mode + "-") for mode in MODES.keys()):
modes.append(MODES[word])
else:
print("Didn't understand: %s" % word)
sys.exit(1)
for mode in MODES.keys():
if word.startswith(mode + "-"):
prefix = word[:len(mode)]
suffix = word[len(mode) + 1:]
modes.append(MODES[prefix] + "-" + suffix)
break
else:
print("Didn't understand: %s" % word)
sys.exit(1)
# Process actions.
for action in actions:
impact = ACTIONS[action]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment