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

Re: completion question

On 5 Feb, Le Wang wrote:
> Hi,
> I have a script that is basically a proxy to run other commands and show the
> output in a new xterm window, e.g.
> ~> xr make
> In this case, how can I get the completion system to ignore "xr" and complete
> for the command?

compdef _precommand xr

> Ohh, and xr can take a single option --nopause, but the option should always
> come before make.

Then you'll need a function specifically for xr:
_xr() { _arguments '--nopause' '*::command:_normal' }

> I'm just starting out with the completion system, the complexity involved
> seems, well, mind boggling.  What are some good resources?

Best introduction is John Beppu's Linux Magazine articles which are
linked to from:

Next, you could try the user guide:


This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.

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