mirror of
https://github.com/gopasspw/gopass.git
synced 2026-03-23 11:32:51 +01:00
This is an attempt to fix the different autocopletion issues. Since I couldn't reproduce most of them, I'm not completely sure if the fixes are effective. Fixes #3086 Fixes #3105 Fixes #3285 Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
13 lines
407 B
Plaintext
13 lines
407 B
Plaintext
_gopass_bash_autocomplete() {
|
|
local cur opts base
|
|
COMPREPLY=()
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
# Use error handling to prevent crashes from invalid flags
|
|
opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion 2>/dev/null ) || opts=""
|
|
local IFS=$'\n'
|
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
return 0
|
|
}
|
|
|
|
complete -F _gopass_bash_autocomplete gopass
|