summaryrefslogtreecommitdiff
path: root/completions/reportbug
blob: c13cc6270e23c81d4f008ea872fb371bc008349d (plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# bash completion for (Debian) reportbug                   -*- shell-script -*-

_reportbug()
{
    local cur prev words cword split
    _init_completion -s || return

    case $prev in
        -f|--filename|-i|--include|--mta|-o|--output|-A|--attach)
            _filedir
            return
            ;;
        -B|--bts)
            COMPREPLY=( $( compgen -W "debian guug kde mandrake help" -- \
                "$cur" ) )
            return
            ;;
        -e|--editor|--mua)
            words=( words[0] "$cur" )
            cword=1
            _command
            return
            ;;
        --mode)
            COMPREPLY=( $( compgen -W "novice standard expert" -- "$cur" ) )
            return
            ;;
        -S|--severity)
            COMPREPLY=( $( compgen -W "grave serious important normal minor
                wishlist" -- "$cur" ) )
            return
            ;;
        -u|--ui|--interface)
            COMPREPLY=( $( compgen -W "newt text gnome" -- "$cur" ) )
            return
            ;;
        -t|--type)
            COMPREPLY=( $( compgen -W "gnats debbugs" -- "$cur" ) )
            return
            ;;
        -T|--tag)
            COMPREPLY=( $( compgen -W "none woody potato sarge sarge-ignore
                etch etch-ignore lenny lenny-ignore sid experimental confirmed
                d-i fixed fixed-in-experimental fixed-upstream help l10n
                moreinfo patch pending security unreproducible upstream wontfix
                ipv6 lfs" -- "$cur" ) )
            return
            ;;
        --from-buildd)
            COMPREPLY=( $( compgen -S "_" -W '$( apt-cache dumpavail | \
                command grep "^Source: $cur" | sort -u | cut -f2 -d" " )' ))
            return
            ;;
        *)
            ;;
    esac

    $split && return

    COMPREPLY=( $( compgen -W '$( _parse_help "$1" )
                       wnpp boot-floppies kernel bugs.debian.org
                       cdimage.debian.org general installation-reports
                       listarchives lists.debian.org mirrors nm.debian.org
                       press project qa.debian.org release-notes
                       security.debian.org tech-ctte upgrade-reports
                       www.debian.org' -- "$cur" )
                $( apt-cache pkgnames -- "$cur" 2>/dev/null ) )
    if [[ $COMPREPLY == -*= ]]; then
        compopt -o nospace
    else
        _filedir
    fi
} &&
complete -F _reportbug reportbug

# ex: filetype=sh