I don't know about you guys, but my argument handling looks something like:
for (int i = 0; i < c; i++)
{
if (strmp(argv[i], "-i") == 0)
{
// do something for -i
}
else if (strmp(argv[i], "-x") == 0)
{
// do something for -x
}
else
{
// do something with the single arg
// normally filename
}
}
Parsing is something totally different and I know I build compilers for a living. ;-)