1
0
Fork 0
devscripts/scripts/chdist.bash_completion
Daniel Baumann b543f2e88d
Adding upstream version 2.25.15.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-21 11:04:07 +02:00

60 lines
1.7 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# /usr/share/bash-completion/completions/chdist
# Bash command completion for chdist(1).
# Documentation: bash(1), section “Programmable Completion”.
_chdist ()
{
local cur=$2 prev=$3
local options='--help -h --data-dir -d --arch -a'
local commands='create apt apt-get apt-cache apt-rdepends aptitude
src2bin bin2src
compare-packages compare-bin-packages
compare-versions compare-bin-versions
grep-dctrl-packages grep-dctrl-sources
list'
# Sync'd with buildd.debian.org on 2016-04-02:
local archs="all alpha amd64 arm64 armel armhf hppa hurd-i386 i386 ia64 kfreebsd-amd64 kfreebsd-i386 m68k mips mips64el mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64 x32"
local dists=$(ls ~/.chdist 2>/dev/null)
COMPREPLY=()
case "$prev" in
-@(-arch|a))
COMPREPLY=( $( compgen -W "$archs" -- $cur ) )
return 0
;;
-@(-data-dir|d))
_filedir
return 0
;;
-@(-help|h)|list)
return 0
;;
create|apt|apt-get|apt-cache|apt-rdepends|aptitude|src2bin|bin2src|compare-packages|compare-bin-packages|compare-versions|compare-bin-versions|grep-dctrl-packages|grep-dctrl-sources)
COMPREPLY=( $( compgen -W "$dists" -- $cur ) )
return 0
esac
if [[ "$cur" == -* ]]; then
# return one of the possible options
COMPREPLY=( $( compgen -W "$options" -- $cur ) )
else
# return one of the possible commands
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
fi
return 0
}
complete -F _chdist chdist
# Local variables:
# coding: utf-8
# mode: shell-script
# indent-tabs-mode: nil
# End:
# vim: fileencoding=utf-8 filetype=sh expandtab shiftwidth=4 :