summary refs log tree commit diff
path: root/etc/completion/bash
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-02-06 17:08:35 +0100
committerLudovic Courtès <ludo@gnu.org>2017-02-07 00:08:10 +0100
commitf2c66fbe1f01b720741e0fe2bfa619ca2862a6b8 (patch)
tree53420eeacee998f0348de9aad14777fa296ee2fa /etc/completion/bash
parenta93c1c59218aac49382c35fe23d1e0f021e6e676 (diff)
downloadguix-f2c66fbe1f01b720741e0fe2bfa619ca2862a6b8.tar.gz
bash completion: Complete subcommands for the current word.
* etc/completion/bash/guix (_guix_complete_subcommand): Refer to
the $COMP_CWORD element instead of the last element.
Diffstat (limited to 'etc/completion/bash')
-rw-r--r--etc/completion/bash/guix2
1 files changed, 1 insertions, 1 deletions
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index 00c3dfaf49..6a5f281c4f 100644
--- a/etc/completion/bash/guix
+++ b/etc/completion/bash/guix
@@ -26,7 +26,7 @@ _guix_complete_subcommand ()
     local subcommands="$(${COMP_WORDS[0]} $command --help 2> /dev/null \
                          | grep '^   [a-z]' \
                          | sed -e's/^ \+\([a-z-]\+\).*$/\1/g')"
-    COMPREPLY=($(compgen -W "$subcommands" -- "${COMP_WORDS[${#COMP_WORDS[*]} - 1]}"))
+    COMPREPLY=($(compgen -W "$subcommands" -- "${COMP_WORDS[$COMP_CWORD]}"))
 }
 
 _guix_complete_available_package ()