Re: [PATCH 2/3] config: set help text for --bool-or-int

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 8, 2009 at 12:48 AM, Jeff King <peff@xxxxxxxx> wrote:
> On Sat, Mar 07, 2009 at 11:07:46PM +0200, Felipe Contreras wrote:
>
>> On Sat, Mar 7, 2009 at 7:14 PM, Jeff King <peff@xxxxxxxx> wrote:
>> > The conversion to parse_opt left this as NULL; on glibc
>> > systems, the usage message prints
>> >
>> >   --bool-or-int   (null)
>> >
>> > and on other ones, segfaults.
>>
>> Shouldn't then OPT_BIT make sure there is no crash?
>
> Perhaps, but it doesn't (and I assume you mean usage_with_help, as
> OPT_BIT is just filling in the struct). It's not clear what a NULL help
> parameter should do, though. Hide the option? Show no help description?
> There are already ways to accomplish both of those.

Yeah, I meant usage_with_help. I don't know what should be done, but I
think two things should be achieved:

a) don't crash
b) encourage the options to always have a description

Perhaps not showing the option at all, or perhaps showing "**EMPTY**".

>> I was surprised when it didn't complain. I thought on making it "" but
>> I wanted to make it visible that there was no documentation for that,
>> which is the reason I left it that way.
>
> OK. I think there are really valid options:
>
>  1. it's there with a description (which is what my patch does)
>
>  2. it's there without a description, because it's obvious what it does
>     coming after --bool and --int

I don't think it's obvious, that partly why I didn't fill the description.

>  3. it's hidden
>
> I really don't care which. But what is there now is broken.

Definitely, your patch must be applied ASAP.

Minor nitpick: "value is interpreted either as bool or int"

The value is what it is, the --boo-or-int option doesn't change the
value, just how it is interpreted.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux