Skip to content

Commit ae84d53

Browse files
rrthomasscop
authored andcommitted
ccache: fix completing compiler's flags
1 parent 33f3ef3 commit ae84d53

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

completions/ccache

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ _ccache()
55
local cur prev words cword split
66
_init_completion -s || return
77

8-
if [[ $COMP_CWORD -eq 1 && ${COMP_WORDS[COMP_CWORD]} != -* ]]; then
9-
_command_offset 1
10-
return
11-
fi
8+
local i
9+
for (( i=1; i <= COMP_CWORD; i++ )); do
10+
if [[ ${COMP_WORDS[i]} != -* ]]; then
11+
_command_offset $i
12+
return
13+
fi
14+
[[ ${COMP_WORDS[i]} == -[oFM] ]] && ((i++))
15+
done
1216

1317
case $prev in
1418
-h|--help|-V|--version|-F|--max-files|-M|--max-size)

0 commit comments

Comments
 (0)