For listing submodules, you could use the same mechanism as git submodule init, look at .gitmodules. This file enumerates each submodule path and the URL it refers to.
For example:
From the root of a repository, cat .gitmodules will print contents to the screen.
Because .gitmodule files have the Git configuration format, you can use git config to parse those files:
git config --file .gitmodules --name-only --get-regexp path
Would show you all submodule entries, and with
git config --file .gitmodules --get-regexp path | awk '{ print $2 }'
you would only get the submodule path itself.
This mechanism will help you to list submodules in a git repository.