From 6c18848a903eb3ee06dccd915859ce64195c257c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 18:24:27 +0200 Subject: Adding upstream version 1:2.11. Signed-off-by: Daniel Baumann --- completions/gpgv | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 completions/gpgv (limited to 'completions/gpgv') diff --git a/completions/gpgv b/completions/gpgv new file mode 100644 index 0000000..29315c9 --- /dev/null +++ b/completions/gpgv @@ -0,0 +1,46 @@ +# gpgv(1) completion -*- shell-script -*- + +_gpgv() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help | --version | --weak-digest | --*-fd | -!(-*)[?h]*) + return + ;; + --keyring) + _filedir "@(gpg|kbx)" + return + ;; + --homedir) + _filedir -d + return + ;; + esac + + local args + _count_args "" "--@(weak-digest|*-fd|keyring|homedir)" + + if [[ $cur == -* && $args -eq 1 ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + return + fi + + if ((args > 1)); then + if [[ ${COMP_LINE,,} == *.@(asc|sig|sign)\ * ]]; then + # Detached signature, only complete one arbitrary file arg and - + if ((args == 2)); then + COMPREPLY=($(compgen -W '-' -- "$cur")) + _filedir + fi + else + _filedir gpg + fi + else + _filedir "@(asc|gpg|sig|sign)" + fi +} && + complete -F _gpgv gpgv gpgv2 + +# ex: filetype=sh -- cgit v1.2.3