Created
December 4, 2017 14:54
-
-
Save macbre/22f2faa98fdb6902d128c8dd8b9a5952 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_sshCompletion () # By convention, the function name | |
{ #+ starts with an underscore. | |
local cur | |
# Pointer to current completion word. | |
# By convention, it's named "cur" but this isn't strictly necessary. | |
COMPREPLY=() # Array variable storing the possible completions. | |
cur=${COMP_WORDS[COMP_CWORD]} | |
COMPREPLY=( $( compgen -W 'dev-macbre cron-s1 job-s1' -- $cur ) ) | |
# Generate the completion matches and load them into $COMPREPLY array. | |
# xx) May add more cases here. | |
# yy) | |
# zz) | |
return 0 | |
} | |
complete -F _sshCompletion ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment