Advertisement
Guest User

geirha

a guest
Mar 2nd, 2012
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. _filedir ()
  2. {
  3. local IFS='
  4. ' xspec;
  5. _expand || return 0;
  6. local -a toks;
  7. local tmp;
  8. toks=(${toks[@]-} $(
  9. compgen -d -- "$(quote_readline "$cur")" | {
  10. while read -r tmp; do
  11. echo $tmp
  12. done
  13. }
  14. ));
  15. if [[ "$1" != -d ]]; then
  16. xspec=${1:+"!*.$1"};
  17. toks=(${toks[@]-} $(
  18. compgen -f -X "$xspec" -- "$(quote_readline "$cur")" | {
  19. while read -r tmp; do
  20. [ -n $tmp ] && echo $tmp
  21. done
  22. }
  23. ));
  24. fi;
  25. COMPREPLY=("${COMPREPLY[@]}" "${toks[@]}")
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement