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