Re: Note to all WLA-DX users: change in argv parser
Posted: Thu Jun 02, 2016 6:29 am
If you need code examples for getopt_long(3), FreeBSD's man page has a decent EXAMPLE section.
NES Development Forums
https://forums.nesdev.org/
And honestly, the real problem is thinking one should only use one approach and never the other. Happens a lot, sadly.byuu wrote:There's really nothing wrong with either approach. The big problem is that one side (usually from the former camp, but not always) loves to denigrate the other side. Humans just seem to have a huge issue with accepting that people who disagree with them aren't malicious, crazy, and/or incompetent.
Looks like you can distinguish between both cases simply by figuring out whether -o is present or not (if it's not present, try to use the last argument as the output instead - that'd make it compatible with old projects).nicklausw wrote:It's one that getopt wouldn't actually help out with, because the args order changed.calima wrote:Eh, "breaking all user projects" is more than a minor issue to me.
Code: Select all
while((opt = getopt(argc, argv, "abc:dDeEfg")) != -1)
{
switch(opt)
{
. . .
}
}
while (optind < argc)
{
// do something with argv[optind++]
}