So I am aware one can edit bash tab completion scripts with functions for a variety of behaviors
I have configured a long list of aws hosts on my .ssh/config, written as dot sepparated names, like so:
Host aws.<stack_name>.<instance_name>
HostName X.X.X.X
by default ssh bash completion scripts display the full list of hosts declared in the config file, and this is pretty good already. But I would like to add to this behavior, which currently displays the list like so:
$ ssh aws.[tab][tab]
aws.stack1.inst1 aws.stack2.inst1
aws.stack1.inst2 aws.stack2.inst2
aws.stack1.inst3 aws.stack3.inst1
aws.stack1.inst4 aws.stack4.inst1
so that I can do the following:
$ ssh aws.[tab][tab]
stack1 stack2 stack3
$ ssh aws.stack1.[tab][tab]
inst1 inst2 inst3 inst4
But I have not been able to figure out how, and where, to add this functionality by navigating through available bash_completion scripts.
I don't want to overwrite the current ssh completion, just extend its behavior when ssh is followed by aws
How/Where can/should I implement this behavior?