I'm writing a bash to process files in a directory. I have some base (quite long) path in which to process. I want to specify via option and argument a sub-path and make it autocompletable. I mean something like this:#!/bin/bashdir=~/path/to/base/dirwhile getopts :d: opt; do    case $opt in      d)         dir=$dir/$OPTARG         ;;      #invalid input handling    esacdoneBut in this implementation the argument is not autocompletable and I have to type all the name of a sub-directory myself (Tab doesn't work).Is there a way to achieve this in bash?
Bash argument autocomplete
bash;autocomplete