I am trying to define a bash function, mycd
. This function uses an associative array mycdar
. If the key exists in the array the function will change directory to the corresponding value of the key. If the key doesn't exist it will change to the dir provided in the command line.
What I would like to do is to have completion for this function, from both they keys of the associated array or from the folders existing in the current directory.
Thank you.