1 # Bash command completion for Debian GNU/Linux dput(1).
3 # This is free software, and you are welcome to redistribute it under
4 # certain conditions; see the end of this file for copyright
5 # information, grant of license, and disclaimer of warranty.
10 local cur prev options paroptions special i delayed_options hosts
13 cur=${COMP_WORDS[COMP_CWORD]}
14 prev=${COMP_WORDS[COMP_CWORD-1]}
15 options='-c --config -d --debug -D --dinstall -f --force -h --help \
16 -H --host-list -l --lintian -o --check-only -p --print \
17 -P --passive -s --simulate -u --unchecked -e --delayed \
18 -v --version -V --check-version'
22 grep "^\[.*\]" $HOME/.dput.cf 2> /dev/null | tr -d [] || /bin/true
23 grep "^\[.*\]" /etc/dput.cf 2> /dev/null | tr -d [] || /bin/true
24 } | grep -v '^DEFAULT$' | sort -u)
26 paroptions="$options $hosts"
30 delayed_options='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15'
31 COMPREPLY=( $( compgen -W "$delayed_options" | grep ^$cur ) )
34 COMPREPLY=( $( compgen -o filenames -G "$cur*" ) )
38 compgen -G "${cur}*.changes"
39 compgen -G "${cur}*.asc"
40 compgen -G "${cur}*.sig"
41 compgen -W "$paroptions" | grep "^$cur"
49 [ "$have" ] && complete -F _dput -o filenames -o plusdirs dput
52 # Copyright © 2015–2016 Ben Finney <bignose@debian.org>
53 # Copyright © 2002 Roland Mas <lolando@debian.org>
55 # This is free software: you may copy, modify, and/or distribute this work
56 # under the terms of the GNU General Public License as published by the
57 # Free Software Foundation; version 3 of that license or any later version.
58 # No warranty expressed or implied. See the file ‘LICENSE.GPL-3’ for details.
64 # vim: fileencoding=utf-8 filetype=sh :