Skip to content

Commit 8c03693

Browse files
committed
Tweak -- logic now that --file arguments could be after
1 parent 6daf30e commit 8c03693

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

refresh.template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,9 +845,9 @@ def _get_commands(target: str, flags: str):
845845
sys.exit(1)
846846

847847
# Detect anything that looks like a build target in the flags, and issue a warning.
848-
# Note that positional arguments after -- are all interpreted as target patterns. (If it's at the end, then no worries.)
848+
# Note that positional arguments after -- are all interpreted as target patterns.
849849
# And that we have to look for targets. checking for a - prefix is not enough. Consider the case of `-c opt` leading to a false positive
850-
if ('--' in additional_flags[:-1]
850+
if ('--' in additional_flags
851851
or any(re.match(r'-?(@|:|//)', f) for f in additional_flags)):
852852
log_warning(""">>> The flags you passed seem to contain targets.
853853
Try adding them as targets in your refresh_compile_commands rather than flags.

0 commit comments

Comments
 (0)