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

Re: Bug#482662: zsh: completion with locate gives extra output



On Sat, May 24, 2008 at 10:16:56PM +0530, Sykora wrote:
> I just typed "locate" at the prompt and pressed space, followed by tab. 
> 
> 
> $> locate Usage: locate [-d path | --database=path] [-e | -E | --[non-]existing]
>       [-i | --ignore-case] [-w | --wholename] [-b | --basename] 
>       [--limit=N | -l N] [-S | --statistics] [-0 | --null] [-c | --count]
>       [-P | -H | --nofollow] [-L | --follow] [-m | --mmap ] [ -s | --stdio ]
>       [-A | --all] [-p | --print] [-r | --regex ] [--regextype=TYPE]
>       [--max-database-age D] [--version] [--help]
>       pattern...
> 
> Report bugs to <bug-findutils@xxxxxxx>.
> <CURSOR HERE>

Ah, okay. You are using GNU locate and I am using mlocate.

> If I try to complete an option, it places the normal completion list
> following the cursor, but after the help text.
> 
> If you're unable to reproduce it, then I'm wondering if it's simply a
> conflict with my shell setup. But yet, when I checked on #zsh, some were
> able to recreate it.
> 
> I'll see if I can find out what it is.
> 
> Further, I found that I could (nominally) fix the problem by commenting
> out :
> 
>     input="$(_call_program locate $words[1])"
>     
> at line 14 of _locate, and setting ltype to gnu directly. But then, I
> have little clue what I did, just thought I'd mention it.

So _locate is trying to match *(#i)gnu locate*, which does not appear in the
`locate -V` output (nor does it appear in the `locate --version` output).
Does anyone have an older version of findutils handy? Would matching for
*findutils* or (#i)*findutils*gnu* cover all possibilities?

% locate: invalid option -- V
Usage: locate [-d path | --database=path] [-e | -E | --[non-]existing]
      [-i | --ignore-case] [-w | --wholename] [-b | --basename] 
      [--limit=N | -l N] [-S | --statistics] [-0 | --null] [-c | --count]
      [-P | -H | --nofollow] [-L | --follow] [-m | --mmap ] [ -s | --stdio ]
      [-A | --all] [-p | --print] [-r | --regex ] [--regextype=TYPE]
      [--max-database-age D] [--version] [--help]
      pattern...

Report bugs to <bug-findutils@xxxxxxx>.

% locate --version
locate (GNU findutils) 4.4.0
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Built using GNU gnulib version e5573b1bad88bfabcda181b9e0125fb0c52b7d3b



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