[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] gawk -h != gawk --help
From: |
Andrew J. Schorr |
Subject: |
Re: [bug-gawk] gawk -h != gawk --help |
Date: |
Mon, 29 Sep 2014 17:52:38 -0400 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Hi,
On Sun, Sep 28, 2014 at 11:32:13PM +0200, Joep van Delft wrote:
> % gawk -h
> gawk: option requires an argument -- h
> (...)
>
> % echo $?
> 1
>
> Yet,
>
> % gawk --help
> (...)
>
> % echo $?
> 0
>
> Is that intentional?
Thanks for the report. It seems that there is a minor bug in main.c.
The "optlist" string is set as follows:
const char *optlist = "+F:f:v:W;bcCd::D::e:E:gh:i:l:L:nNo::Op::MPrStVY";
This contrasts with
{ "help", no_argument, NULL, 'h' },
There seems to be a stray colon after the "h" in optlist. If that
is removed, the exit status will be zero in both cases.
The attached patch seems to fix the problem.
Regards,
Andy
help.patch
Description: Text document