////////////////////////////////////////////////////////////////////////// AddArg //////////////////////////////////////////////////////////////////////////
| 50 | // AddArg |
| 51 | /////////////////////////////////////////////////////////////////////////////// |
| 52 | void cCmdLineParser::AddArg( |
| 53 | int argId, const TSTRING& arg, const TSTRING& alias, ParamCount numParams, bool multipleAllowed) |
| 54 | { |
| 55 | if (arg.empty() && alias.empty()) |
| 56 | { |
| 57 | // this refers to the list of parameters that comes after all the cmd line switches |
| 58 | mLastArgInfo.mId = argId; |
| 59 | mLastArgInfo.mNumParams = numParams; |
| 60 | return; |
| 61 | } |
| 62 | |
| 63 | if (!arg.empty()) |
| 64 | mArgTable.Insert(arg, cArgInfo(argId, numParams)); |
| 65 | if (!alias.empty()) |
| 66 | { |
| 67 | // put the alias in the table with a '-' prepended to it so it matches '--' |
| 68 | TSTRING str(_T("-")); |
| 69 | str += alias; |
| 70 | mArgTable.Insert(str, cArgInfo(argId, numParams)); |
| 71 | } |
| 72 | // This argument can appear more than once on the command line. |
| 73 | if (multipleAllowed) |
| 74 | mMultipleAllowed.insert(argId); |
| 75 | } |
| 76 | |
| 77 | /////////////////////////////////////////////////////////////////////////////// |
| 78 | // Clear |