help / color / mirror / code / Atom feed
* Programmatically loading completion for another command?
@ 2022-05-27 16:29 Vorpal
  2022-05-27 17:03 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Vorpal @ 2022-05-27 16:29 UTC (permalink / raw)
  To: Zsh hackers list


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


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 

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-02  4:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-27 16:29 Programmatically loading completion for another command? Vorpal
2022-05-27 17:03 ` Bart Schaefer
2022-05-27 17:46   ` Daniel Shahaf
2022-05-27 19:58     ` Vorpal
2022-06-02  4:09       ` Bart Schaefer

Code repositories for project(s) associated with this inbox:


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).