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.
See also issue 7426 and issue 7493
(In reply to comment #1) > See also issue 7426 and issue 7493 Oh my, I meant issue 7421 and issue 7693
----- 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.