Changeset 14326 in vbox
- Timestamp:
- Nov 18, 2008 8:04:36 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 39527
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/getopt.h
r8245 r14326 171 171 * int main(int argc, char *argv[]) 172 172 * { 173 * static const RTOPTIONDEF g_aOptions[] =173 * static const RTOPTIONDEF s_aOptions[] = 174 174 * { 175 175 * { "--optwithstring", 's', RTGETOPT_REQ_STRING }, … … 181 181 * int i = 1; 182 182 * RTOPTIONUNION ValueUnion; 183 * while ((ch = RTGetOpt(argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), &i, &ValueUnion)))183 * while ((ch = RTGetOpt(argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), &i, &ValueUnion))) 184 184 * { 185 * if (ch < 0) { .... error }186 *187 185 * // for options that require an argument, ValueUnion has received the value 188 186 * switch (ch) … … 199 197 * g_fOptVerbose = true; 200 198 * break; 199 * 200 * default: 201 * if (ch > 0) 202 * Error("missing case: %c\n", ch); 203 * else if (ValueUnion.pDef) 204 * Error("%s: %Rrc, ValueUnion.pDef->pszLong); 205 * else 206 * Error("%Rrc, ValueUnion.pDef->pszLong); 207 * return 1; 201 208 * } 202 209 * }
Note:
See TracChangeset
for help on using the changeset viewer.