I am very happy to get tab completion with the following code snippet in my .bashrc:
cd () {
command cd "$@";
if [ -f ./Rakefile ]; then
complete -W "$(rake -T | awk 'NR != 1 {print $2}')" rake
else
complete -r rake
fi
}
This command will be loaded when entering the directory using cd. If the directory does not contain a rakefile, the message "bash: complete: rake: no specification specification" appears. Is it possible to omit this message?
Thanks for your help Matthias
source
share