I want to enable bash tab-complete to look for directories, but not in the current directory.

So for instance, if I do:

```
$ ls $P
dirs/ are/ here/
$ cd /not/the/P/path
$ ls
other/ stuff/
$ myProg <tab>
dirs/ are/ here

```

This changes the usual behavior, where I would normally see files in the current directory. 

**Due diligence:** The best I could come up with is:

```
_myProg ()
{
  local cur

  COMPREPLY=()
  cur=${COMP_WORDS[COMP_CWORD]}

  if [ "${P}x" = "x" ]; then
    return 1
  fi

  case "$cur" in
    *)
      pth=${P}/$( echo $cur | egrep -o "^.*/[^/]*$" )
      COMPREPLY=( $( compgen -W "$( cd $pth && ls -1d "$cur"* 2>/dev/null -- "$cur" )" ) )
      ;;
  esac

  return 0
}
complete -o nospace -F _myProg myProg

```

which initially shows directories, but doesnt let me drill down into the directories how I want (like `ls` works).