File: dupload.bash-completion

package info (click to toggle)
dupload 2.9.5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 208 kB
  • sloc: perl: 1,286; makefile: 57; sh: 43
file content (36 lines) | stat: -rw-r--r-- 893 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Debian dupload(1) completion
# Original file:
#   Debian dput(1) completion
#   Copyright 2002 Roland Mas <lolando@debian.org>
# Modified for dupload(1)
#   Paul Evans <leonerd@leonerd.org.uk>

have dupload &&
_dupload()
{
    local cur prev options paroptions special i delayed_options hosts

    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}
    prev=${COMP_WORDS[COMP_CWORD-1]}
    options='-c --configfile -d --debug -f --force -k --keep --no --nomail \
        --mailonly --noarchive -p --print -q --quiet -t --to -V -Version'

    case $prev in
	--config|-c)
	    COMPREPLY=( $( compgen -o filenames -G "$cur*" ) )
	    ;;
	*)
	    COMPREPLY=( $(
		    compgen -G "${cur}*.changes"
		    compgen -G "${cur}*.asc"
		    compgen -G "${cur}*.sig"
		    compgen -W "$options" | grep "^$cur"
		) )
	    ;;
    esac

    return 0

}
[ "$have" ] && complete -F _dupload -o filenames dupload