yeah, I dont really want to add a package for what I can do in one line in tcsh. I want to replicate what I have in tcsh in bash.
I wasn't suggesting you install that package, just look at the source to see how it's done.
Anyways it looks like the bash completion functions aren't as terse as tcsh, the following seems to work for me:
case "$prev" in
-p) COMPREPLY=( $(compgen -W "$(echo first-pkg second-pkg third-pkg)" -- "$cur") );;
-c) COMPREPLY=( $(compgen -W "$(echo first-conf second-conf third-conf)" -- "$cur") );;
*) COMPREPLY=( $(compgen -W '-p -c' -- "$cur") );;
complete -F _test test
Where you would replace $(echo first-pkg second-pkg third-pkg)
with the appropriate command.