For a long time I used scp to move files back and forth between machines over ssh, but everyone says rsync is better. In particular because, unlike scp, it can resume interrupted transfers. So when at some point I ran into a server that simply doesn't support scp (it downloads a few kilobytes and drops the connection), I switched to rsync.
I made myself an alias so I don't have to type the flags every time:
alias rsync-my="rsync -avp --partial --progress --append-verify"
but it turned out that as soon as I use rsync-my instead of rsync, tab completion of directories on the server disappears.
No problem. Let's see which completion rsync uses:
complete -p rsync
We see: complete -o nospace -F _comp_cmd_rsync rsync
And we simply add the same thing for our alias (in ~/.bashrc):
source /usr/share/bash-completion/completions/rsync
complete -o nospace -F _comp_cmd_rsync rsync-my
Now completion works and life has become a little better.