.bash_completion
changeset 319 d0201811d371
parent 318 68363fe03ae4
child 552 1f489f80b389
equal deleted inserted replaced
315:c15b2b668c00 319:d0201811d371
       
     1 # -*- mode: shell-script -*-
     1 
     2 
     2 # user commands see only users
     3 # user commands see only users
     3 complete -u su passwd write chfn groups slay w sux
     4 complete -u su passwd write chfn groups slay w sux
     4 
     5 
     5 # bg completes with stopped jobs
     6 # bg completes with stopped jobs
    60   if [[ -z "${CDPATH:-}" || "$cur" == ?(.)?(.)/* ]]; then
    61   if [[ -z "${CDPATH:-}" || "$cur" == ?(.)?(.)/* ]]; then
    61     COMPREPLY=( $(compgen -d -- "$cur") )
    62     COMPREPLY=( $(compgen -d -- "$cur") )
    62     return 0
    63     return 0
    63   fi
    64   fi
    64   local i j k
    65   local i j k
       
    66   k=0
    65   for i in ${CDPATH//:/$'\n'}; do
    67   for i in ${CDPATH//:/$'\n'}; do
    66     k="${#COMPREPLY[@]}"
       
    67     for j in $( compgen -d -- $i/$cur ); do
    68     for j in $( compgen -d -- $i/$cur ); do
    68       COMPREPLY[k++]=${j#$i/}
    69       COMPREPLY[k++]=${j#$i/}
    69     done
    70     done
    70   done
    71   done
    71   return 0
    72   return 0