Sha256: 6c0761dcb1ea54979e594cde179cf5c10b6571a276832e01b17151c15a592aa3

Contents?: true

Size: 670 Bytes

Versions: 14

Compression:

Stored size: 670 Bytes

Contents

# Source this script from ~/.bash_profile
_hook_targets()
{
    local cmds cur ff
    if (($COMP_CWORD == 1))
    then
        cur="${COMP_WORDS[1]}"
        cmds="$(hook help -c)"
        COMPREPLY=($(compgen -W "$cmds" -- "$cur"))
        COMPREPLY=( "${COMPREPLY[@]/%/ }" )
    else
        # get all matching files and directories
        COMPREPLY=($(compgen -f  -- "${COMP_WORDS[$COMP_CWORD]}"))

        for ((ff=0; ff<${#COMPREPLY[@]}; ff++)); do
            [[ -d ${COMPREPLY[$ff]} ]] && COMPREPLY[$ff]+='/'
            [[ -f ${COMPREPLY[$ff]} ]] && COMPREPLY[$ff]+=' '
        done
    fi
}

complete -o bashdefault -o default -o nospace -F _hook_targets hook

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
hookapp-2.1.1 lib/completion/hook_completion.bash
hookapp-2.1.0 lib/completion/hook_completion.bash
hookapp-2.0.16 lib/completion/hook_completion.bash
hookapp-2.0.15 lib/completion/hook_completion.bash
hookapp-2.0.13 lib/completion/hook_completion.bash
hookapp-2.0.12 lib/completion/hook_completion.bash
hookapp-2.0.11 lib/completion/hook_completion.bash
hookapp-2.0.10 lib/completion/hook_completion.bash
hookapp-2.0.9 lib/completion/hook_completion.bash
hookapp-2.0.8 lib/completion/hook_completion.bash
hookapp-2.0.7 lib/completion/hook_completion.bash
hookapp-2.0.5 lib/completion/hook_completion.bash
hookapp-2.0.4 lib/completion/hook_completion.bash
hookapp-2.0.3 lib/completion/hook_completion.bash