obsolete D libraries/modules

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Sep 2 07:16:30 PDT 2013


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?


More information about the Digitalmars-d mailing list