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

Re: why '_file -/' completes files if there is no directory?



On 2013/08/08, at 15:56, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>  Here's your answer:
> 
> zstyle -e ':completion::*' file-patterns \
> 	'[[ $funcstack[1] = _files && $type = */* ]] && reply=("*(/)")'

Thanks!, this is exactly what I'm looking for.

Now 'rmdir <TAB>' gives a warning as I expect.
Interestingly, 'gcc -I<TAB>' gives nothing, i.e., not completes
normal files nor gives a warning.
This is not a problem for me (it's OK if I don't get a list of normal files),
but I'm just curious why no warning?
'gcc -I./<TAB>' does give a warning, though.

This happens only if the optspec given to _arguments has the form '*-I-'.
Either '-I-' or '*-I' gives a warning. 



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