How to reset the bash completion after a parameter

68 views Asked by At

I'm creating a completion function (through complete -F) for a command which takes another command as trailing parameters. For example:

command exec -- another_command

Now I know I can match on the "exec --" part and return:

COMPREPLY=( $(compgen -c) )

which correctly gives the list of possible options. Unfortunately this does not work correctly for another_command's arguments - I'm still running the command completion instead.

How can I completely reset the completion state at exec -- and tell bash to reevaluate from there as if it was a new line?

0

There are 0 answers