summaryrefslogtreecommitdiff
path: root/completions/kill
blob: 4cd5f9112fa8fabf06ac920efec80a6a0f2bb5c0 (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
# kill(1) completion                                       -*- shell-script -*-

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

    case $prev in
        -s)
            _signals
            return
            ;;
        -l)
            return
            ;;
    esac

    if [[ $cword -eq 1 && "$cur" == -* ]]; then
        # return list of available signals
        _signals -
        COMPREPLY+=( $(compgen -W "-s -l" -- "$cur") )
    else
        # return list of available PIDs
        _pids
    fi
} &&
complete -F _kill kill

# ex: filetype=sh