On 9/2/13, Jacob Carlborg <[email protected]> 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?
