summaryrefslogtreecommitdiffstats
path: root/completions/userdel
blob: e95da5c358933eb16e813e77a1197b415e6e7acc (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
# userdel(8) completion                                    -*- shell-script -*-

_comp_cmd_userdel()
{
    local cur prev words cword comp_args
    _comp_initialize -- "$@" || return

    local noargopts='!(-*|*[R]*)'
    # shellcheck disable=SC2254
    case $prev in
        --help | -${noargopts}h)
            return
            ;;
        --root | -${noargopts}R)
            _comp_compgen_filedir -d
            return
            ;;
    esac

    if [[ $cur == -* ]]; then
        _comp_compgen_help
        return
    fi

    _comp_compgen -- -u
} &&
    complete -F _comp_cmd_userdel userdel

# ex: filetype=sh