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

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

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

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

    _comp_compgen_filedir
} &&
    complete -F _comp_cmd_chrpath chrpath

# ex: filetype=sh