Loading...

How to enable bash auto-completion for a function?

Answer #1 100 %

The completion function for ssh here is _ssh.

You can see this with complete -p ssh (it should also have been in your grep output) though it appears to be auto-loaded and so will not show up until after you have used it once in that session.

Anyway, that being said you should just be able to hook _ssh up to your function as well I would think.

complete -F _ssh myfunc

You’ll also like:


© 2022 CodeForDev.com -