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

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



> 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.

Hmm, maybe just adding "." to the info path to search is OK?  But I don't
know if that handles absolute filenames.

pws




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