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

Re: Compctl completion tweaking



On Jun 23,  4:57pm, Johan Sundström wrote:
} Subject: Compctl completion tweaking
}
} I've been trying for some time to limit completion behaviour for some
} commands in an intelligent manner. What I am trying to do is mask out
} files not matching a given pattern, keeping directories intact

In 3.1.4, what you'd want (I think) is

	compctl -g '*.rpm(.)' -/ rpm

The -/ flag is new and means "filesystem paths".  You may not even need
the (.) in the -g pattern, unless you have some files with .rpm extensions
that aren't plain files.

} better still, matching files according to some pattern and directories
} according to some other pattern. Shouldn't that be possible using
} something like -g '(*.rpm(.))|(*(-/))'?

Unfortunately, qualifiers can only be appended at the end of an entire
glob.  If you parenthesize them in an alternation like that, they're
taken as part of the pattern rather than as qualifiers.

} Secondly, is there any way I can influence the sorting compctl does?

Not at present.

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



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