std.getopt suggestion

Jonathan M Davis jmdavisProg at gmx.com
Wed Sep 28 14:10:05 PDT 2011


On Wednesday, September 28, 2011 13:59 Nick Sabalausky wrote:
> I like it. I wonder if having the GetOpt struct's defaults being different
> from getopt() might be confusing. Other than that, I can't think of any
> issues with any of it, unless there was some other aspect of the API we'd
> want to change, too.

getOpt's defaults would be exactly the same as GetOpt's defaults, because it 
would be using GetOpt.init. If fact, getOpt's body would likely be pretty much 
just

GetOpt.init.getOpt(args);

It's getopt's defaults that might vary. If they vary, it's because we decided 
that the defaults should be changed, and GetOpt and the new getOpt reflect the 
changes, but the old getopt would keep its behavior and be put on the 
deprecation path.

- Jonathan M Davis


More information about the Digitalmars-d mailing list