Zsh Mailing List Archive
Messages sorted by:
Re: completion issue
- X-seq: zsh-users 18905
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "Vadim A. Misbakh-Soloviov" <mva@xxxxxxxx>, zsh-users@xxxxxxx
- Subject: Re: completion issue
- Date: Wed, 11 Jun 2014 10:29:54 -0700
- In-reply-to: <1698300.E1kUrWqTui@note>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <2653527.uOyQYmyBdV@note> <1698300.E1kUrWqTui@note>
On Jun 11, 4:06pm, Vadim A. Misbakh-Soloviov wrote:
} Little update:
} I just fuound, that problem is in my
} > zstyle ':completion:::::' completer _expand _force_rehash _complete _ignored _gnu_generic _approximate
} > zstyle ':completion:*' completer _complete _ignored _gnu_generic _approximate _oldlist _force_rehash
Ah ... _gnu_generic is not intended to be placed in the "completer" style.
It's designed to be called from (or in place of) a completion function
for a specific command. There are some special requirements needed for
functions in the "completer" style that most of the other functions do
not meet; a few work anyway by accident, but _gnu_generic is not one.
Hence the _gnu_generic documentation note that says:
The completion system as supplied is conservative in its use of
this function, since it is important to be sure the command
understands the option `--help'.
This could probably go on to say that the command must not merely
understand --help, it must produce the help output in the specific
formatting that FSF software normally employs.
The actual --help parser is in the _arguments function itself. Look for
# Now get the long option names by calling the command with `--help'.
# The parameter expansion trickery first gets the lines as separate
# array elements. Then we select all lines whose first non-blank
# character is a hyphen. Since some commands document more than one
# option per line, separated by commas, we convert commas into
# newlines and then split the result again at newlines after joining
# the old array elements with newlines between them. Then we select
# those elements that start with two hyphens, remove anything up to
# those hyphens and anything from the space or tab after the
# option up to the end.
Messages sorted by: