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

Re: _find or _users broken?



On Apr 29,  1:58pm, Adam Spiers wrote:
} Subject: _find or _users broken?
}
} $ find -user <TAB>
} ---- user
} ---- directory
} <list of directories and users together>
} $ find ! -user <TAB>
} ---- directory
} <list of directories>
} 
} Why is it completing directories at all?  And when it completes users
} and directories, why are the users listed under the directory group?

That part must have something to do with your settings.  The final clause
of the _arguments call in _find is to complete directories when nothing
else matches.

There is something going wrong, though:

zagzig[103] find -user <TAB>
Completing user
(list of users only)
zagzig[103] find /tmp -user <TAB>
(feep, no completions)

This (and your case with `!') appears to happen because comparguments
believes the list of options to have been finished when /tmp was put
on the line, i.e., it doesn't deal well with commands whose options
follow a list of non-option arguments.

It may be necessary to rewrite _find using _regex_arguments, or to go
to a state-machine rather than a simple usage of _arguments.  I'm not
yet clever enough with _arguments to figure out a workaround, and I'm
totally unfamiliar with _regex_arguments.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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