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", , NULL) /* the last
> argument is the default value */
>
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
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
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
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 */
> }
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=", )) {
/* do something
6 matches
Mail list logo