From efe47381c599b07e4c7bbdb2e91e8090a541c887 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:53:52 +0200 Subject: Adding upstream version 2.23.4+deb12u1. Signed-off-by: Daniel Baumann --- scripts/debsign.bash_completion | 99 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 scripts/debsign.bash_completion (limited to 'scripts/debsign.bash_completion') diff --git a/scripts/debsign.bash_completion b/scripts/debsign.bash_completion new file mode 100644 index 0000000..a7b72fb --- /dev/null +++ b/scripts/debsign.bash_completion @@ -0,0 +1,99 @@ +# /usr/share/bash-completion/completions/debsign +# Bash command completion for ‘debsign(1)’. +# Documentation: ‘bash(1)’, section “Programmable Completion”. + +shopt -s progcomp + +_have _debsign_completion && +_debsign_completion () { + COMPREPLY=() + + local cur="${COMP_WORDS[COMP_CWORD]}" + local prev="${COMP_WORDS[COMP_CWORD-1]}" + + local options=( + -h --help --version + -r -m -e -k + -a -t --multi + -p --debs-dir + -S + --re-sign --no-re-sign + --no-conf --noconf + ) + + case "$prev" in + -r) + # The option requires a non-option argument here, but we + # have no feasible way to generate auto-completion matches + # for ‘username@remotehost’. Use an empty set. + local host_options="" + COMPREPLY=( $(compgen -W "$host_options" -- "$cur") ) + ;; + + -m|-e) + # The previous option requires an argument, but we + # have no feasible way to generate auto-completion matches + # for a maintainer identifier. Use an empty set. + local maintainer_options="" + COMPREPLY=( $(compgen -W "$maintainer_options" -- "$cur") ) + ;; + + -k) + # Provide completions for GnuPG secret key IDs. + local keyid_options=$( + gpg --fixed-list-mode --with-colons --fingerprint \ + --list-secret-keys \ + | awk -F':' '/^sec/{print $5}' ) + COMPREPLY=( $( + compgen -W "$keyid_options" | grep "^${cur:-.}" + ) ) + ;; + + -a) + # Provide completions for system architecture identifiers. + local arch_options=$(dpkg-architecture --list-known) + COMPREPLY=( $(compgen -W "$arch_options" -- "$cur") ) + ;; + + -t) + # The previous option requires an argument, but we + # have no feasible way to generate auto-completion matches + # for a GNU system type identifier. Use an empty set. + local type_options="" + COMPREPLY=( $(compgen -W "$type_options" -- "$cur") ) + ;; + + -p) + # Provide completions for available commands. + COMPREPLY=( $(compgen -A command -- "$cur") ) + ;; + + --debs-dir) + # Provide completions for existing directory paths. + COMPREPLY=( $(compgen -o dirnames -A directory -- "$cur") ) + ;; + + *) + COMPREPLY=( $( + compgen -G "${cur}*.changes" + compgen -G "${cur}*.buildinfo" + compgen -G "${cur}*.dsc" + compgen -G "${cur}*.commands" + compgen -W "${options[*]}" -- "$cur" + ) ) + compopt -o filenames + compopt -o plusdirs + ;; + esac + + return 0 + +} && complete -F _debsign_completion debsign + + +# Local variables: +# coding: utf-8 +# mode: shell-script +# indent-tabs-mode: nil +# End: +# vim: fileencoding=utf-8 filetype=sh expandtab shiftwidth=4 : -- cgit v1.2.3