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

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

    case $prev in
        --help | --version | --split | -[hs])
            return
            ;;
    esac

    # --split takes 3 args
    local i
    for i in {1..3}; do
        [[ ${words[cword - i]} == -@(-split|s) ]] && return
    done

    [[ $cur != -* ]] ||
        _comp_compgen_help
} &&
    complete -F _comp_cmd_ipcalc ipcalc

# ex: filetype=sh