1 # Bash command completion for Debian GNU/Linux dput(1).
3 # Copyright © 2015 Ben Finney <ben+debian@benfinney.id.au>
4 # Copyright © 2002 Roland Mas <lolando@debian.org>
9 local cur prev options paroptions special i delayed_options hosts
12 cur=${COMP_WORDS[COMP_CWORD]}
13 prev=${COMP_WORDS[COMP_CWORD-1]}
14 options='-c --config -d --debug -D --dinstall -f --force -h --help \
15 -H --host-list -l --lintian -o --check-only -p --print \
16 -P --passive -s --simulate -u --unchecked -e --delayed \
17 -v --version -V --check-version'
21 grep "^\[.*\]" $HOME/.dput.cf 2> /dev/null | tr -d [] || /bin/true
22 grep "^\[.*\]" /etc/dput.cf 2> /dev/null | tr -d [] || /bin/true
23 } | grep -v '^DEFAULT$' | sort -u)
25 paroptions="$options $hosts"
29 delayed_options='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15'
30 COMPREPLY=( $( compgen -W "$delayed_options" | grep ^$cur ) )
33 COMPREPLY=( $( compgen -o filenames -G "$cur*" ) )
37 compgen -G "${cur}*.changes"
38 compgen -G "${cur}*.asc"
39 compgen -G "${cur}*.sig"
40 compgen -W "$paroptions" | grep "^$cur"
48 [ "$have" ] && complete -F _dput -o filenames -o plusdirs dput
55 # vim: fileencoding=utf-8 filetype=sh :