import std.getopt;
void usage() {}
void main(string[] args)
{
getopt(args, "help", {usage();});
}
This works in 2.057 and Andrei believes it is intended to work.
Comment #1 by lovelydear — 2012-04-20T00:54:51Z
See also issue 7426 and issue 7493
Comment #2 by lovelydear — 2012-04-20T00:57:20Z
(In reply to comment #1)
> See also issue 7426 and issue 7493
Oh my, I meant issue 7421 and issue 7693
Comment #3 by andrej.mitrovich — 2014-03-24T10:33:54Z
-----
import std.getopt;
void usage() { assert(0); } // will throw
void main(string[] args)
{
getopt(args, "help", {usage();});
}
-----
Seems to work in 2.064/2.065.