I have a bunch of aliases that I've used on my 12.04 machine.
alias pssh="tsocks ssh" alias pscp="tsocks scp" alias prdp="tsocks xfreerdp ..........SOMETHING ...."
These aliases are modifications of regular linux commands (scp,ssh ect.) therefore I'd like these aliases to have the same autocomplete rules as their original counterparts. I don't want to write my own rules as the rules for the regular commands are perfectly fine.
In 12.04 the following worked perfectly:
complete -F _ssh pssh complete -F _scp pscp complete -F _ssh prdp
This doesn't work in 14.04. If I try to autocomplete I get the following error:
bash: completion: function `_ssh' not found
If I autocomplete on ssh before I try pssh everything works. As far as I know, it's because the autocomplete rules are not loaded before they are used. Until the autocomplete rules for ssh gets loaded, my rules are invalid and result in an error.
How to I fix this, how do I correctly hook my alias into an autocomplete rule defined for a regular linux command?