Christian Couder writes:
> In the few cases where do_something() accepts NULL and does something
> different with it, the former can be changed to:
>
> if (skip_to_optional_val(arg, "--key", &arg, NULL) /* the last
> argument is the default value */
> do_something(arg);
T
On Sun, Dec 3, 2017 at 11:48 PM, Junio C Hamano wrote:
> Christian Couder writes:
>
>> Anyway there is a design choice to be made. Adding a "const char
>> *default" argument makes the function more generic,...
>
> I didn't suggest anything of that sort, and I do not understand why
> you are repea
Christian Couder writes:
> Anyway there is a design choice to be made. Adding a "const char
> *default" argument makes the function more generic,...
I didn't suggest anything of that sort, and I do not understand why
you are repeatedly talking about "default" that you considered and
rejected, as
On Sun, Dec 3, 2017 at 7:45 PM, Junio C Hamano wrote:
> Christian Couder writes:
>
>> From: Christian Couder
>>
>> We often accept both a "--key" option and a "--key=" option.
>>
>> These options currently are parsed using something like:
>>
>> if (!strcmp(arg, "--key")) {
>> /* do somethi
Christian Couder writes:
> From: Christian Couder
>
> We often accept both a "--key" option and a "--key=" option.
>
> These options currently are parsed using something like:
>
> if (!strcmp(arg, "--key")) {
> /* do something */
> } else if (skip_prefix(arg, "--key=", &arg)) {
> /*
From: Christian Couder
We often accept both a "--key" option and a "--key=" option.
These options currently are parsed using something like:
if (!strcmp(arg, "--key")) {
/* do something */
} else if (skip_prefix(arg, "--key=", &arg)) {
/* do something with arg */
}
which is a b
6 matches
Mail list logo