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

Re: [PATCH] getopts: Accurately report '-x' or '+x' in error messages



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