summaryrefslogtreecommitdiff
path: root/completions/nsupdate
blob: 68df333e35971bb141b18a30409d10901e435f4d (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
# bash completion for nsupdate(1)                          -*- shell-script -*-

_nsupdate()
{
    local cur prev words cword
    _init_completion || return

    case $prev in
        -*[VLprtu])
            return
            ;;
        -*k)
            _filedir key
            return
            ;;
        -*R)
            cur=${cur:=/dev/}
            _filedir
            return
            ;;
        -*y)
            if [[ $cur == h* ]]; then
                COMPREPLY=($(compgen -W "hmac-{md5,sha{1,224,256,384,512}}" \
                    -S : -- "$cur"))
                [[ ${COMPREPLY-} == *: ]] && compopt -o nospace
            fi
            return
            ;;
    esac

    if [[ $cur == -* ]]; then
        COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur"))
        return
    fi

    _filedir
} &&
    complete -F _nsupdate nsupdate

# ex: filetype=sh