allow non-bash scripts to provide tab completions

change grep based comment matching to detect completions to test
that a subcommand responds to `--complete' to allow scripts where
comments are of an incompatible format to provide tab completions