author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Mon, 02 Dec 2019 20:05:19 +0200 | |
changeset 931 | 0110114150ad |
parent 930 | e867bffa536e |
child 932 | 75fd41de9786 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.bash_completion.d/gssh Mon Dec 02 20:05:19 2019 +0200 @@ -0,0 +1,11 @@ +alias gssh='gcloud compute ssh' + +_gssh() { + local cur=${COMP_WORDS[COMP_CWORD]} + [[ "$cur" = -* ]] && return 0 + local hosts=$(gcloud compute instances list --format='value(name)') + COMPREPLY=( $(compgen -W "$hosts" -- "$cur") ) + return 0 +} + +complete -F _gssh gssh