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.
This commit is contained in:
parent
a93c1c5921
commit
f2c66fbe1f
|
@ -26,7 +26,7 @@ _guix_complete_subcommand ()
|
||||||
local subcommands="$(${COMP_WORDS[0]} $command --help 2> /dev/null \
|
local subcommands="$(${COMP_WORDS[0]} $command --help 2> /dev/null \
|
||||||
| grep '^ [a-z]' \
|
| grep '^ [a-z]' \
|
||||||
| sed -e's/^ \+\([a-z-]\+\).*$/\1/g')"
|
| 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 ()
|
_guix_complete_available_package ()
|
||||||
|
|
Loading…
Reference in New Issue