Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion for man (_man) patch to support -M
- X-seq: zsh-users 15466
- From: Silas Silva <silasdb@xxxxxxxxx>
- To: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- Subject: Re: Completion for man (_man) patch to support -M
- Date: Thu, 21 Oct 2010 20:19:07 -0200
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=SThDa3Uh3TfUD7NV2Gi9fJfow386c1zXDS7beZANpkI=; b=p18gwrBj/nYwlNJgUYohpMiXQwFwbk4DQankPd+fzcz2BKr1mQQu3+mPUq72kh9osa 6YuHgrdKkI2QKfbX4vQOm3MMa2JM+XN0zhqlIe4/AcbYdoaQ39hSH9fGz/G8GID6tuci iCZs7xdUUZKVXBC6O6gZYwxvGFUJW8tKnQlu4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=IOk2Qy5Mm5pF5LWaXTBk06FTl6D+CMObEv07J+Ivnb3pV1D4r8C4phIPA+CJ8LzMvh 28+tYXJa+eVws/9pHN72qUxPzG3wLpUx51FblwHg2CFnlxJiAa3CFe0Ui0RYlqqul6nk tsppwyFN1JN0LZMXMqmUSep3tM1OOXaO5aNP4=
- In-reply-to: <20101021202912.6e26ce87@xxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20101021151504.GA24694@xxxxxxxxxxxxxxxxxxxxxxxxxx> <20101021202912.6e26ce87@xxxxxxxxxxxxxxxxxxx>
On Thu, Oct 21, 2010 at 08:29:12PM +0100, Peter Stephenson wrote:
> On Thu, 21 Oct 2010 13:15:14 -0200
> Silas Silva <silasdb@xxxxxxxxx> wrote:
> > I was studying the completion system and, since I would like to add
> > support for -M for the _man completion, I've done it. Dirty and ugly
> > patch is attached.
>
> Not sure how widespread support for that argument is, certainly man is
> historically rather different on different systems, but _man already
> doesn't look much like other completion functions, and the intention
> here is obvious enough, so I've committed it.
Yeah... I tested it under NetBSD and GNU/Linux. It might work under
other BSDs as well, but I don't know about other Unices.
> > I'm just not sure if it is the better way to do it. opt holds the
> > option passed to the -M flag, but (( $words[(I)-M]+1 )) looks ugly?
>
> Well, apart from the obvious use of a variable (and omitting the
> parentheses),
>
> integer ind=$words[(I)-M]
> if (( ind )); then
> local opt
> opt=$words[ind+1]
> _manpath=($_manpath $opt)
> fi
>
> I don't see a major improvement. (I'll commit this improvement on top.)
Yeah, having the obvious use of a variable is a good practice. Thanks
for the lesson and for the commit. :-)
--
Silas Silva
Messages sorted by:
Reverse Date,
Date,
Thread,
Author