aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2021-10-30 16:34:10 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2021-10-31 00:57:07 +0200
commit0987a0eba4e8220e98e93686a4ad3ef87433fb2f (patch)
tree0824de4decbf91dad94112a76d3f5ae90c3957a2 /etc
parent8f455557814ef7c1402a81d87e9e45f3508f711e (diff)
downloadguix-0987a0eba4e8220e98e93686a4ad3ef87433fb2f.tar.gz
guix-0987a0eba4e8220e98e93686a4ad3ef87433fb2f.zip
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".
Diffstat (limited to 'etc')
-rw-r--r--etc/completion/bash/guix3
1 files changed, 2 insertions, 1 deletions
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index ec6adfdb22..5d1ae37f12 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"))
}