It is easy to overlook an already assigned single-letter option name
and try to use it for a new one. Help the developer to catch it
before such a mistake escapes the lab.
This retroactively forbids any short option name (which is defined
to be of type "int") outside the ASCII printable range. W
René Scharfe writes:
>> Not quite, as an opt with long name is reported with the long name
>> only, which is not very nice when the problem we are reporting is
>> about its short variant.
>
> Perhaps something like the patch below helps, here and in general?
Excellent. Not just this particular
Am 04.09.2014 um 00:16 schrieb Junio C Hamano:
> René Scharfe writes:
>
>>> It bugged me enough that we didn't identify which short option
>>> letter we were complaining about
>>
>> The old code did report the short option. E.g. for t1502 it said:
>>
>> error: BUG: switch 'b' short name alr
René Scharfe writes:
>> It bugged me enough that we didn't identify which short option
>> letter we were complaining about
>
> The old code did report the short option. E.g. for t1502 it said:
>
> error: BUG: switch 'b' short name already used
>
> You can leave that to optbug(), no need fo
On Wed, Sep 03, 2014 at 02:46:25PM -0700, Jonathan Nieder wrote:
> Junio C Hamano wrote:
>
> > --- a/parse-options.c
> > +++ b/parse-options.c
> > @@ -345,12 +345,27 @@ static void check_typos(const char *arg, const struct
> > option *options)
> > static void parse_options_check(const struct opt
bject: [PATCH] parse-options: detect attempt to add a duplicate short option
name
It is easy to overlook an already assigned single-letter option name
and try to use it for a new one. Help the developer to catch it
before such a mistake escapes the lab.
Helped-by: René Scharfe
Signed-off-by: J
Junio C Hamano wrote:
> --- a/parse-options.c
> +++ b/parse-options.c
> @@ -345,12 +345,27 @@ static void check_typos(const char *arg, const struct
> option *options)
> static void parse_options_check(const struct option *opts)
> {
> int err = 0;
> + char short_opts[128];
> +
> +
usefulness.
We might want to tighten the type of the short_name member to
unsigned char, but I didn't go that far yet, at least in this step.
-- >8 --
Subject: [PATCH] parse-options: detect attempt to add a duplicate short option
name
It is easy to overlook an already assigned single-le
Am 03.09.2014 um 21:42 schrieb Junio C Hamano:
> Junio C Hamano writes:
>
>>> diff --git a/builtin/revert.c b/builtin/revert.c
>>> index f9ed5bd..831c2cd 100644
>>> --- a/builtin/revert.c
>>> +++ b/builtin/revert.c
>>> @@ -91,6 +91,7 @@ static void parse_args(int argc, const char **argv,
>>> str
Junio C Hamano writes:
>> diff --git a/builtin/revert.c b/builtin/revert.c
>> index f9ed5bd..831c2cd 100644
>> --- a/builtin/revert.c
>> +++ b/builtin/revert.c
>> @@ -91,6 +91,7 @@ static void parse_args(int argc, const char **argv, struct
>> replay_opts *opts)
>> N_("option
10 matches
Mail list logo