Is it possible to programmatically get a command's definition so that its completion function can be called manually? Alternatively, is it possible to define a command such that the first argument is used to determine the completion function to use?
What I'm trying to do:
I have some commands (
Cmd2, etc.) that are defined with their own completion function using the
-complete flag. The completion function might be a custom function or may be one of the built in options like
I'm now creating a "wrapper command" (
WrapperCmd) that would take in a command name and that command's arguments. So, invoking things would be something like this:
:WrapperCmd Cmd1 cmd1-argument
:WrapperCmd Cmd1 the completion options should be the ones relevant to
Cmd1 and after typing
:WrapperCmd Cmd2 the completion options should be the ones relevant to
I really struggled to come up with a clear and succinct way of phrasing the title (perhaps an indication that I'm trying to get too weird with things). Suggestions for improving it are more than welcome.