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".
This commit is contained in:
parent
8f45555781
commit
0987a0eba4
@ -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"))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user