--- /etc/bash_completion.d/tree.orig 2012-05-27 09:02:32.230962292 +0200 +++ /etc/bash_completion.d/tree 2012-05-27 09:12:02.854828511 +0200 @@ -15,7 +15,7 @@ --dirsfirst --charset --help" if [[ ${cur} == -* ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi @@ -23,10 +23,10 @@ -L|-P|-I|-H|-T|--charset|--help) ;; -o) - COMPREPLY=( $(compgen -f -- ${cur}) ) + _filedir ;; *) - COMPREPLY=( $(compgen -d -- ${cur}) ) + _filedir -d ;; esac }