GetOpt formatting improvements

Benjamin Franksen benjamin.franksen at
Wed Jul 2 12:37:14 EDT 2008

Neil Mitchell wrote:
>>  Anyway, the maximum output width, as well as a maximum indentation for
>>  the option descriptions should be arguments to (new, additional)
>>  functions getOptExt and usageInfoExt, with the old getOpt and usageInfo
>>  being defined in terms of the new variants.
> I think thats a really bad idea. We want options that work and do the
> sensible thing. When would a user want to set these options to
> different values? Without a use case, and a potential user, these
> extra variants are a waste of hard-drive space.

I thought the use case I had in mind was apparent from the context: finding
out the terminal width and then setting the wrap-width accordingly. And the
max. description indentation could be set as a percentage of the terminal
width. This is all quite similar to what pretty printing libs allow.

Generally I think that hard-coding numerical constants in code is nearly
always a very bad idea. Much worse than adding a few 100 bytes to the


More information about the Libraries mailing list