.bash_completion
changeset 972 27754771cbb6
parent 885 bfbd7fdc89f8
child 1007 0077617b0deb
equal deleted inserted replaced
971:c4a808f66996 972:27754771cbb6
    57 }
    57 }
    58 complete -F _pathsearch -o nospace pathsearch
    58 complete -F _pathsearch -o nospace pathsearch
    59 
    59 
    60 _mycd() {
    60 _mycd() {
    61   local cur
    61   local cur
       
    62   local IFS=$'\n'
    62   cur=${COMP_WORDS[COMP_CWORD]}
    63   cur=${COMP_WORDS[COMP_CWORD]}
    63   if [[ -z "${CDPATH:-}" ]] || [[ $cur == ?(.)?(.)/* ]] || [[ $cur == '~'/* ]]; then
    64   if [[ -z "${CDPATH:-}" ]] || [[ $cur == ?(.)?(.)/* ]] || [[ $cur == '~'/* ]]; then
    64     compopt -o dirnames; COMPREPLY=()
    65     compopt -o dirnames; COMPREPLY=()
    65     return 0
    66     return 0
    66   fi
    67   fi