ssh - How to enable bash auto-completion for a function? -
i have read tutorial on bash auto-completion an introduction bash completion , trying same auto-completion done ssh 1 of functions (that loaded .profile); acts pretty alias.
what trying : same auto-completion, provided default ssh (which function _known_hosts; complete -p | grep ssh , complete -f _known_hosts /etc/init.d/ssh), , own function (which installed woul install alias, , in fact scp , ssh original argument)
the completion function ssh here _ssh.
you can see complete -p ssh (it should have been in grep output) though appears auto-loaded , not show until after have used once in session.
anyway, being said should able hook _ssh function think.
complete -f _ssh myfunc 
Comments
Post a Comment