https://d.puremagic.com/issues/show_bug.cgi?id=11737



--- Comment #4 from Andrei Alexandrescu <[email protected]> 2013-12-15 11:24:12 
PST ---
Upon a bit more thinking, the trick is rather subtle. Perhaps it would be more
straightforward to allow two lambdas with the same option, and invoke the
appropriate one.

import std.getopt;
import std.stdio;

void main(string[] args)
{
    getopt(args,
           "log",
           (string option)  // should allow '--log'
           {
           },
           "log",
           (string option, string value)  // should allow '--log=value'
           {
           });
);
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to