Configure Bash completion - 0mp/goat GitHub Wiki

You might want to add the following lines to ~/.bash_completion:

# Do not run the loop if there are no files in ~/.bash_completion.d/. 
# Using a wildcard globbing in an empty directory results in an error.
if ! find ~/.bash_completion.d/. ! -name . -prune -exec false {} +
then
    for f in ~/.bash_completion.d/*
    do
        source "$f"
    done
fi

https://serverfault.com/q/506612/291898