From 0987a0eba4e8220e98e93686a4ad3ef87433fb2f Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sat, 30 Oct 2021 16:34:10 +0200 Subject: 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(-) (limited to 'etc/completion/bash') 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")) } -- cgit v1.2.3