bash-completion: fix completion of complete verbs

When doing 'command verb<TAB>', the arguments for verb would be
proposed, but it is too early. We should complete verb first.

https://bugs.freedesktop.org/show_bug.cgi?id=74596
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2014-02-06 00:45:00 -05:00
parent 97e0691f85
commit 3ce09b7da2
8 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -146,7 +146,7 @@ _systemctl () {
[TARGETS]='set-default'
)
for ((i=0; i <= COMP_CWORD; i++)); do
for ((i=0; i < COMP_CWORD; i++)); do
if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} &&
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
verb=${COMP_WORDS[i]}