Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Programmatically loading completion for another command?



Hi,

I'm writing completion for a command that has an option like:

  --makepkg-args=comma,separated,list

where the comma separated list are arguments to the makepkg command.

I thus though I could use "_sequence _makepkg". Unfortunately this doesn't work if the user hasn't tried to tab complete "makepkg" yet.

Even more annoying _makepkg is defined in a file with a different name (_pacman) and the following #compdef at the top:

#compdef pacman pacman.static=pacman pacman-conf pacman-key makepkg

I.e. _makepkg is not the main "service" of the completion definition file. That file has a main completion function that dispatches on $service

* How do I trigger loading that file from my completion so I can offer completions to the flag --makepkg-args? Is it even possible? * Or should I make a wrapper that calls _pacman and overrides $service locally?

Both of these approaches seem rather hackish. It would be nice if I could ask zsh: give me whatever is used to complete the command "makepkg".

Best regards,
Arvid Norlander




Messages sorted by: Reverse Date, Date, Thread, Author