diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:53:52 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:53:52 +0000 |
commit | efe47381c599b07e4c7bbdb2e91e8090a541c887 (patch) | |
tree | 05cf57183f5a23394eca11b00f97a74a5dfdf79d /scripts/debuild.bash_completion | |
parent | Initial commit. (diff) | |
download | devscripts-upstream.tar.xz devscripts-upstream.zip |
Adding upstream version 2.23.4+deb12u1.upstream/2.23.4+deb12u1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/debuild.bash_completion')
-rw-r--r-- | scripts/debuild.bash_completion | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/scripts/debuild.bash_completion b/scripts/debuild.bash_completion new file mode 100644 index 0000000..22787bc --- /dev/null +++ b/scripts/debuild.bash_completion @@ -0,0 +1,103 @@ +# /usr/share/bash-completion/completions/debuild +# Bash command completion for ‘debuild(1)’. +# Documentation: ‘bash(1)’, section “Programmable Completion”. + +# Copyright © 2015, Nicholas Bamber <nicholas@periapt.co.uk> + +_debuild() +{ + local cur prev words cword i _options special _prefix + _init_completion || return + + for (( i=${#words[@]}-1; i > 0; i-- )); do + if [[ ${words[i]} == @(binary|binary-arch|binary-indep|clean|--lintian-opts) ]]; then + special=${words[i]} + break + fi + done + + if [[ -n $special ]]; then + + case $special in + --lintian-opts) + case $prev in + --include-dir) + COMPREPLY=( $( compgen -o filenames -d -- "$cur" ) ) + return 0 + ;; + --tags-from-file|--cfg|--suppress-tags-from-file) + COMPREPLY=( $( compgen -o filenames -f -- "$cur" ) ) + return 0 + ;; + --color) + COMPREPLY=( $( compgen -W 'never always auto html' -- "$cur" ) ) + return 0 + ;; + --display-source) + COMPREPLY=( $( compgen -W 'policy devref' -- "$cur" ) ) + return 0 + ;; + esac + COMPREPLY=( $( compgen -W '-C --ftp-master-rejects --tags --tags-from-file --color --default-display-level --display-source --display-experimental --no-display-experimental --fail-on-warnings --info --display-info --no-override --pedantic --show-overrides --suppress-tags --suppress-tags-from-file --cfg --no-cfg --ignore-lintian-env --include-dir' -- "$cur" ) ) + return 0 + ;; + *) + COMPREPLY=( $( compgen -W 'binary binary-arch binary-indep clean' -- "$cur" ) ) + return 0 + ;; + esac + fi + + case $prev in + --rootcmd) + _options= + for i in fakeroot super sudo + do + which $i > /dev/null && _options+=" ${i}" + done + COMPREPLY=( $( compgen -W "${_options}" -- "$cur" ) ) + return 0 + ;; + --preserve-envvar) + COMPREPLY=( $( compgen -o nospace -e -- "$cur" ) ) + return 0 + ;; + --set-envvar) + COMPREPLY=( $( compgen -o nospace -e -S'=' -- "$cur" ) ) + return 0 + ;; + --prepend-path|--admindir) + COMPREPLY=( $( compgen -o filenames -d -- "$cur" )) + return 0 + ;; + --check-dirname-level) + COMPREPLY=( $( compgen -W '0 1 2' -- "$cur" ) ) + return 0 + ;; + -j) + COMPREPLY=( $( compgen -W 'auto 1 2 3 4 5 6' -- "$cur" ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + _options='--preserve-envvar --set-envvar --rootcmd --preserve-env --prepend-path --lintian --no-lintian --no-tgz-check --tgz-check --username --clear-hooks --check-dirname-level --check-dirname-regex -d -D --dpkg-buildpackage-hook --clean-hook --dpkg-source-hook --dpkg-build-hook --dpkg-binary-hook --dpkg-genchanges-hook --final-clean-hook --lintian-hook signing-hook post-dpkg-buildpackage-hook --lintian-opts -g -G -b -B -A -S -F -si -sa -sd -v -C -m -e -a --host-type --target-arch --target-type -P -j -D -d -nc -tc --admindir --changes-options --source-options -z -Z -i -I -sn -ss -sA -sk -su -sr -sK -sU -sR --force-sign -us -uc -k -p --check-option --check-command -R -r' + if [[ "$prev" == debuild ]]; then + _options+=' --no-conf' + fi + COMPREPLY=( $( compgen -W "${_options}" -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W 'binary binary-arch binary-indep clean' -- "$cur" ) ) + fi + + return 0 +} && +complete -F _debuild debuild + + +# Local variables: +# coding: utf-8 +# mode: shell-script +# indent-tabs-mode: nil +# End: +# vim: fileencoding=utf-8 filetype=sh expandtab shiftwidth=4 : |