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

Re: Completion help



On Mon, 12 May 2008 10:12:33 -0400
"praful mathur" <dasickis@xxxxxxxxx> wrote:
> Can someone please direct me where this question has already been answered?
> I've tried looking in zshall but I can't quite find an answer to my
> question.

I didn't really follow your original question since you're code doesn't
seem to correspond to how the completion system actually works.

If you want to know how to use _arguments, start by looking at the many
existing completion functions that call _arguments and compare with what's
in the description for _arguments in the zshcompsys manual page.

For example, _hash (in Completion/Zsh/Command in the source) has the same
problem of dealing with an option -d that gets followed by a directory and
isn't as hairy of some of the files.  You will have to look around and if
you get stuck ask *specific* questions with which people will have more
time to help.

If you want a step-by-step guide, try the online guide at
http://zsh.sunsite.dk/Guide/zshguide06.html#l177
(that's the tutorial section for completion: you might want to start
earlier).

For more detailed guidance, our book

From Bash to Z Shell: Conquering the Command Line (Paperback) 
 by Oliver Kiddle (Author), Jerry Peek (Author), Peter Stephenson (Author) 
Paperback: 472 pages
Publisher: APRESS (1 Dec 2004)
Language English
ISBN-10: 1590593766
ISBN-13: 978-1590593769

has a lot on completion.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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