I am trying to save bash completion suggestions to use them. So, I am trying to simulate two tabs and pipe the result to something else. I am looking for something like:
$ getCompletions git checkout
master
branch_1
otherBranch
$ getCompletions git checkout | grep '^ma'
master
I am trying to find a solution for an arbitrary command or at least just git.