summaryrefslogtreecommitdiffstats
path: root/completions/killall
blob: c7c0b0fc3719ba67d7a61020ba6c52755a78977a (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
# killall(1) completion                                    -*- shell-script -*-

[[ $OSTYPE == *@(linux|freebsd|darwin)* ]] || return 1

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

    case $prev in
        --context | --older-than | --younger-than | --version | -!(-*)@([Zoy]|V*))
            return
            ;;
        --signal | -!(-*)s)
            _signals
            return
            ;;
        --user | -!(-*)u)
            _allowed_users
            return
            ;;
    esac

    $split && return

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

    _pnames
} &&
    complete -F _killall killall

# ex: filetype=sh