Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] getopts: Accurately report '-x' or '+x' in error messages
- X-seq: zsh-workers 42064
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: dana <dana@xxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: [PATCH] getopts: Accurately report '-x' or '+x' in error messages
- Date: Fri, 01 Dec 2017 09:20:26 +0000
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20171201092030euoutp015578cdf9c186cab472c68475c02e0013~8ISfumdaH0300703007euoutp01-
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1512120030; bh=W5QEUNBPvLf7mlon6D+2Omr+c/rw7w9jcgCz6jXM4d0=; h=Date:From:To:Subject:In-reply-to:References:From; b=W5SpIckaSxQO8zwOszGittUolsuScA7E/cJM3bBfbMwnh/mfeDcR1gGGqbKkZsybl AwhttHR4MFxFIrfd+c4upmvDOjcKDPjg3w5g4rIDF2eyazY7n6MDg7whkJORNZn5zD 2jQx8HorGyEwyOLCaAupz/S5aWOH0489VoUuwkOU=
- In-reply-to: <733779CE-86B9-4178-B38B-7E64390BB4C6@dana.is>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CGME20171201071310epcas1p4e06bf3264433a5d7318fbb9d6c594c18@epcas1p4.samsung.com> <733779CE-86B9-4178-B38B-7E64390BB4C6@dana.is>
On Fri, 1 Dec 2017 01:12:15 -0600
dana <dana@xxxxxxx> wrote:
> getopts error messages about illegal options or missing values always reference
> the -x variant of the option, even if the +x one was used instead. The included
> patch simply makes it report the correct prefix.
>
> PS: There are a few other places in the code where it seems that the - prefix is
> hard-coded into the error message, but i didn't actually check to see if that
> was a problem. This patch in addition to the previous one should cover most
> cases people are likely to run into, though, i'd think.
>
> PPS: I didn't add any tests because there aren't any for getopts — let me know
> if you'd like me to create some.
Thanks, I've committed this. I'd be happy to add some getopts tests if
you came up with any.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author