guix-commits
[Top][All Lists]
Advanced

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

08/13: bash completion: Don't hard-code "guix" binary name.


From: guix-commits
Subject: 08/13: bash completion: Don't hard-code "guix" binary name.
Date: Sat, 30 Oct 2021 18:58:34 -0400 (EDT)

nckx pushed a commit to branch master
in repository guix.

commit 0987a0eba4e8220e98e93686a4ad3ef87433fb2f
Author: Tobias Geerinckx-Rice <me@tobias.gr>
AuthorDate: Sat Oct 30 16:34:10 2021 +0200

    bash completion: Don't hard-code "guix" binary name.
    
    * etc/completion/bash/guix (_guix_complete_command):
    Use ${COMP_WORDS[0]} instead of hard-coding "guix".
---
 etc/completion/bash/guix | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index ec6adfd..5d1ae37 100644
--- a/etc/completion/bash/guix
+++ b/etc/completion/bash/guix
@@ -28,10 +28,11 @@ _guix_complete_command ()
     if [ -z "$_guix_commands" ]
     then
        # Cache the list of commands to speed things up.
-       _guix_commands="$(guix --help 2> /dev/null  \
+       _guix_commands="$(${COMP_WORDS[0]} --help 2> /dev/null  \
                                      | grep '^    ' \
                                     | sed '-es/^ *\([a-z-]\+\).*$/\1/g')"
     fi
+
     COMPREPLY+=($(compgen -W "$_guix_commands" -- "$word_at_point"))
 }
 



reply via email to

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