guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/09: bash completion: Complete subcommands for the current word.


From: Ludovic Courtès
Subject: 05/09: bash completion: Complete subcommands for the current word.
Date: Mon, 6 Feb 2017 23:08:27 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit f2c66fbe1f01b720741e0fe2bfa619ca2862a6b8
Author: Ludovic Courtès <address@hidden>
Date:   Mon Feb 6 17:08:35 2017 +0100

    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.
---
 etc/completion/bash/guix |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index 00c3dfa..6a5f281 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 ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]