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