summaryrefslogtreecommitdiffstats
path: root/completions/ipcalc
blob: 5603c26cea00f45355894c8def44a271a3e42397 (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 -*-

_ipcalc()
{
    local cur prev words cword
    _init_completion || 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 != -* ]] ||
        COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
} &&
    complete -F _ipcalc ipcalc

# ex: filetype=sh