switch(toupper(argv[index][1])){ case 'D': if(('-'!=argv[index+1][0]) && ('/'!=argv[index+1][0])) { strcpy(gRootDir,argv[index+1]); index++; }
switch(argv[index][1]){ case 'd': case 'D': gRootDir = argv[index+1]; index++;
void ConsumeArguments(int argc, char* argv[]) {  if(argc<2) {    cout << "Usage: dreftool -h -d sourcepath" << endl;    cout << "-D path to root of source tree" << endl;    cout << "-H emit as HTML" << endl;    exit(1);  }  for(int index=1;index<argc;index++){    switch(argv[index][0]) {      case '-':      case '/':        switch(toupper(argv[index][1])){          case 'D': //to specify starting directory            if(('-'!=argv[index+1][0]) && ('/'!=argv[index+1][0])) {              strcpy(gRootDir,argv[index+1]);              index++;            }            break;          case 'H': //user chose to show redundant include errors            gEmitHTML=true;            break;          default:            break;        }        break;      default:        break;    }  }}