Changeset 17092 in vbox
- Timestamp:
- Feb 24, 2009 7:57:52 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/getopt.h
r17091 r17092 176 176 * Initialize the RTGetOpt state. 177 177 * 178 * @returns VINF_SUCCESS, or VERR_INVALID_PARAMETER if fFlags is invalid. 178 * The passed in argument vector may be sorted if fFlags indicates that this is 179 * desired (to be implemented). 180 * 181 * @returns VINF_SUCCESS, VERR_INVALID_PARAMETER or VERR_INVALID_POINTER. 179 182 * @param pState The state. 180 183 * -
trunk/src/VBox/Main/webservice/vboxweb.cpp
r17089 r17092 131 131 ****************************************************************************/ 132 132 133 static const RT OPTIONDEF g_aOptions[]133 static const RTGETOPTDEF g_aOptions[] 134 134 = { 135 135 { "--help", 'h', RTGETOPT_REQ_NOTHING }, … … 255 255 int c; 256 256 int i = 1; 257 RTOPTIONUNION ValueUnion; 258 while ((c = RTGetOpt(argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), &i, &ValueUnion))) 257 RTGETOPTUNION ValueUnion; 258 RTGETOPTSTATE GetState; 259 RTGetOptInit(&GetState, argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), 1, 0 /* fFlags */); 260 while ((c = RTGetOpt(&GetState, &ValueUnion))) 259 261 { 260 262 switch (c) … … 324 326 break; 325 327 #endif 326 } 327 } 328 if (i != argc) 329 { 330 RTStrmPrintf(g_pStdErr, "Unknown option %s\n", argv[i]); 331 exit(1); 328 case VINF_GETOPT_NOT_OPTION: 329 RTStrmPrintf(g_pStdErr, "Unknown option %s\n", argv[i]); 330 return 1; 331 } 332 332 } 333 333
Note:
See TracChangeset
for help on using the changeset viewer.