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

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

    case $prev in
        -*[lmp])
            return
            ;;
    esac

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

    local ipvx
    [[ $1 == *6 ]] && ipvx=-6
    _comp_compgen_known_hosts ${ipvx-} -- "$cur"
} &&
    complete -F _comp_cmd_tracepath tracepath tracepath6

# ex: filetype=sh