# HG changeset patch # User Oleksandr Gavenko # Date 1575309919 -7200 # Node ID 0110114150adaf38c394887a08c2485d454c0bd6 # Parent e867bffa536e1de9f9f00f98891526718a82e892 Added alias and completion for 'gcloud compute ssh'. diff -r e867bffa536e -r 0110114150ad .bash_completion.d/gssh --- /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