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

Re: completion for "info -f" does not work



> 2022/03/17 0:06, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> 
>> On 16 March 2022 at 08:46 Jun T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
>>> 2022/03/16 3:05, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
>>> 
>>> +    if [[ $PREFIX = (./|../|/)* ]]; then
>>> +      files=( $^infopath/*.info(|.gz|.bz2)(-.:t:s/.gz//:s/.bz2//:r) )
>>> +      tags=(files)
>>> +      items=()
>>> +    else
>> (snip)
>>> +    _requested files expl 'file' && _files -g '*.info(|.gz|.bz2)'
>> 
>> 'info -f' accept any (relative or absolute) pathnames. For example,
>> info -f foo/bar.info
>> works; we need not type ./foo/bar.info.
>> So the pattern (./|../|/)* is to restrictive, I think.
>> # And if tags is set only to (files), we need not set the array files.
>> 
>> For the -f option, isn't it simpler just to use the action
>> _files -g "*.info(|.gz|.bz2)"
>> instead of
>> ->infofiles ?
> 
> For "info", at least, it will complete files in the info area as well
> as local files, so at the least we're looking at combining the two
> types.

I feel just '_files -g "*.info(|.gz|.bz2)"' is enough for 'info -f'.
But if we want to combine it with files in infopath, we need to set
tags=(files info-files), am I right?




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