| ␉this->checkreq = true;␍␊ |
| ␉// Assumptions:␍␊ |
| ␉// *) options will not start with -␍␊ |
| ␉// *) parameters will not be repeated␍␊ |
| ␉// *) parameters will not be repeated\␍␊ |
| ␉// *) Parameters are in order␍␊ |
| ␉int z = 0;␍␊ |
| ␉for(int i = 1; i < argc; i++)␍␊ |
| ␉for(int i = 1; i < argc - 1; i++)␍␊ |
| ␉{␍␊ |
| ␍␊ |
| ␉␉if (argv[i][0] == '-')␍␊ |
|
| void pparser::printusage(const char * header, const char * pname, const char * footer)␍␊ |
| {␍␊ |
| ␉pout.put(header);␍␊ |
| ␉pout.put("\n");␍␊ |
| ␉if (this->invalidparas.get_count() > 0)␍␊ |
| ␉{␍␊ |
| ␉␉pout.put("Invalid parameters: ");␍␊ |
|
| ␉␉else␍␊ |
| ␉␉␉parameterlist += "[-" + (*this->paras)[i]->shortparameter + "] ";␍␊ |
| ␉␉␍␊ |
| ␉␉paralisthints += "-" + (*this->paras)[i]->shortparameter + ", --" + (*this->paras)[i]->longparameter + "\n" + (*this->paras)[i]->hint;␍␊ |
| ␉␉paralisthints += "-" + (*this->paras)[i]->shortparameter + ", --" + (*this->paras)[i]->longparameter + "\n" + (*this->paras)[i]->hint + "\n\n";␍␊ |
| ␉}␍␊ |
| ␉pout.put(parameterlist);␍␊ |
| ␉pout.put("\n");␍␊ |