Which shell are you using? If you are using bash you may need to enable "advanced" completions in bash...

if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

In your ~/.bashrc

On OSX you can do:

$ sudo port install bash-completion

To your ~/.profile add:

if [ -f /opt/local/etc/bash_completion ]; then
    . /opt/local/etc/bash_completion
fi

If anyone is wanting to do this for Mac OSX Mountain Lion with rkthkr's method, they have to install Mac Ports (http://www.macports.org/install.php) first, run the command he mentioned:

$ sudo port install bash-completion

then configure their terminal app per these instructions found here: https://trac.macports.org/wiki/howto/bash-completion