I have asked myself this question - but I still have not found a solution.
you are able to list the files and
(sub)directories in a directory.
list directory entries instead of contents
(from ls --help).
I think this means that you can see all (sub)directories in the choosen directory. Further I think if you can find this out, it's simple to write a short script doing what you want.
The problem is: ls -d shows me only the directory itself with one dot. nothing more.