Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Broken fetchmail completion
- X-seq: zsh-workers 26059
- From: Baptiste Daroussin <baptiste.daroussin@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Broken fetchmail completion
- Date: Mon, 17 Nov 2008 23:39:22 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:date:from:to:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=+X9DOVbxJJdT+XDm+brslIVJGhSQH3AILq7XsZzkNDU=; b=etr4YppYfP5T6qq8BcNqfhX/l+eE+8vj5QOTgFZs+InuEjaVl0A1ZKjrSIRHQWPyN4 wOcuglLPI3wdaw9IHfSAoMPMxMC5ZuYkq/Vmx4gU80SlO9Vpk1J8UmledoY0rCZKFkDi Cl6HNHzTeQznT9v+obvDxpY6w9nPtkkwlYN74=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=uU39OxFW2wvFu4Cq1x1FMvJuBQsWzNKbNJG8FVJ2omrMMNjUOGCLkjoO7/YjPTen7V Kq9I2JfFB0UCPB6XbMwAYa8OhINSO8Wwbq8IUFKS6JHqOO8uIzyBsxLnw8UrCRukdFYm QUuKCnJFBr9jAPMPDRJc9Plev8hntJsfujPF8=
- In-reply-to: <20081117102906.35dbf2f5@news01>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20081117094831.GB57162@xxxxxxxxxxx> <20081117102906.35dbf2f5@news01>
Thanks it works perfectly.
Bapt
On Mon, Nov 17, 2008 at 10:29:06AM +0000, Peter Stephenson wrote:
> On Mon, 17 Nov 2008 10:48:31 +0100
> Baptiste Daroussin <baptiste.daroussin@xxxxxxxxx> wrote:
> > The fetchmail completion is broken in in 4.3.9 :
> > _arguments:comparguments:303: invalid option definition: --[fetch]all[retrieve
> > old and new messages]
> > _arguments:comparguments:303: invalid option definition: --[fetch]all[retrieve
> > old and new messages]
> > _arguments:comparguments:303: invalid option definition: --[fetch]all[retrieve
> > old and new messages]
>
> The problem's not so much with the version of the shell (thought that may
> have an effect) as with the version of fetchmail which is generating a help
> string
>
> -a, --[fetch]all retrieve old and new messages
>
> which is confusing the shell. This turns it into the options --fetchall
> and --all, which seems to be the intention. I don't know how common this
> is; in principle you might get weird and wonderful syntax along those
> lines, but I think we'll just have to wait and see.
>
> > The _fetchmail seems to be obsolete.
>
> I'm not sure what the point of having some arguments there but using --help
> to get others is, but it might be for older versions of fetchmail.
>
> Index: Completion/Base/Utility/_arguments
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_arguments,v
> retrieving revision 1.21
> diff -u -r1.21 _arguments
> --- Completion/Base/Utility/_arguments 13 Dec 2007 22:05:59 -0000 1.21
> +++ Completion/Base/Utility/_arguments 17 Nov 2008 10:25:34 -0000
> @@ -5,7 +5,7 @@
>
> local long cmd="$words[1]" descr odescr mesg subopts opt opt2 usecc autod
> local oldcontext="$curcontext" hasopts rawret optarg singopt alwopt
> -local setnormarg
> +local setnormarg start rest
> local -a match mbegin mend
>
> long=$argv[(I)--]
> @@ -97,10 +97,19 @@
> # present. Maybe the problem was that the intervening code
> # didn't. If it's buggy without removing them, the problem
> # probably is later, not here.
> - if [[ -z ${tmp[(r)${match[1]%%[^a-zA-Z0-9_-]#}]} ]]; then
> - tmp+=($match[1])
> + start=${match[1]}
> + rest=${match[2]}
> + if [[ -z ${tmp[(r)${start%%[^a-zA-Z0-9_-]#}]} ]]; then
> + # variant syntax seen in fetchmail:
> + # --[fetch]all means --fetchall or --all.
> + # maybe needs to be more general
> + if [[ $start = (#b)(*)\[(*)\](*) ]]; then
> + tmp+=("${match[1]}${match[2]}${match[3]}" "${match[1]}${match[3]}")
> + else
> + tmp+=($start)
> + fi
> fi
> - opt=$match[2]
> + opt=$rest
> done
> # If there's left over text, assume it's a description; it
> # may be truncated but if it's too long it's no use anyway.
>
> --
> Peter Stephenson <pws@xxxxxxx> Software Engineer
> CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
> Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author