Which argument is the completion closure called for

When creating a custom completion, a closure is called that is passed all the currently typed in arguments. Is there a way to tell which arguement the user is editing that causes the closure to be called?

My command is basically a move command that takes two arguments, old location and new location (groups and items). When the custom completion closure is called, it’s passed all the arguments so it cant tell whether is use the typing the second argument or if they moved their cursor and are editing the first one again.

I'd like to take the text the user has typed and use that to filter the completion suggestions. I'd like to just suggest the groups or items in the group the user has currently typed.