obsolete D libraries/modules

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Sep 3 08:20:55 PDT 2013


On 9/2/13 7:16 AM, Andrej Mitrovic wrote:
> On 9/2/13, Jacob Carlborg <doob at me.com> wrote:
>> This is a simple idea:
>>
>> uint timeout;
>> getopt(args, "timeout|t", &timeout).help("Set the timeout");
>
> W.r.t. help strings, I would prefer if we could instead use:
>
> getopt(args,
>    "timeout|t", &timeout, "Set the timeout",
>    "other", &other,  // note: no comment!
>    "flag|f", &flag, "Set the flag")
>
> I think we could make getopt support this. For example:
>
> ["foo", &foo] => name, field
> ["foo", &foo, "foo text"] => name, field, #3 is a comment
> ["foo", &foo, "foo text", "bar", &bar] => #3 is a commen
> ["foo", &foo, "foo text", &bar] => #3 is a new name
>
> Essentially all getopt has to do is slice up the arguments into
> groups, where an address and the string before it begin a new group.
>
> @Andrei: What do you think?

Sounds great. There's a related bugzilla entry IIRC.

Andrei




More information about the Digitalmars-d mailing list