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

Re: bug in 'rm' completion



On Nov 9, 11:17am, Greg Klanderman wrote:
}
} The patch below seems to fix the problem, provided you are completing
} the last word on the line.

You forgot the patch.

} Can someone explain where $line is coming from in _rm?

It's declared in both _main_complete and _arguments and appears to be
set by "comparguments -W" at _arguments:377.  Unfortunately there's no
good documentation for "comparguments" because it was treated as a
helper builtin that no end user would ever need to call directly.

} BTW, what's the deal with _files vs _path_files?

The main thing is that _files handles grouping the files according
to the files, directories, etc. according to the file-patterns zstyle.
_path_files is a lower-level function that manages the path traversal
to find appropriate files to complete.  Most cases probably ought to
be calling _files unless the intent is to impose a different kind of
grouping or to avoid having file-patterns applied, but it's a bit of a
judgment call in each instance.



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