Browse Source

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.
wip-git-https
Ludovic Courtès 5 years ago
parent
commit
f2c66fbe1f
No known key found for this signature in database GPG Key ID: 90B11993D9AEBB5
  1. 2
      etc/completion/bash/guix

2
etc/completion/bash/guix

@ -26,7 +26,7 @@ _guix_complete_subcommand ()
local subcommands="$(${COMP_WORDS[0]} $command --help 2> /dev/null \
| grep '^ [a-z]' \
| 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 ()

Loading…
Cancel
Save