summaryrefslogtreecommitdiffstats
path: root/completions/help
blob: 679ea9fdbb5566ec76d245e71efa525226c1c373 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# bash completion for help                                 -*- shell-script -*-

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

    if [[ $cur == -* ]]; then
        _comp_compgen_usage -c help -s "$1"
        return
    fi

    _comp_compgen -- -A helptopic
    ((${#COMPREPLY[*]} != 1)) || printf -v "COMPREPLY[0]" %q "$COMPREPLY"
} &&
    complete -F _comp_cmd_help help