verify-flags-underscore.py: ignore 'flags' that look like bash variables

We ignore bad 'flags' if they are proceeded by $ or { as these are
likely bash variables and not in fact bad flag usage.
This commit is contained in:
Eric Paris
2015-08-14 14:46:12 -04:00
parent 055d648ed7
commit 7f96f9312b
2 changed files with 1 additions and 25 deletions

View File

@@ -164,7 +164,7 @@ def flags_to_re(flags):
# turn all flag names into regexs which will find both types
newre = dashRE.sub('[-_]', flag)
# only match if there is not a leading or trailing alphanumeric character
flagREs.append("[^\w]" + newre + "[^\w]")
flagREs.append("[^\w${]" + newre + "[^\w]")
# turn that list of regex strings into a single large RE
flagRE = "|".join(flagREs)
flagRE = re.compile(flagRE)