Changeset 19526 in vbox
- Timestamp:
- May 8, 2009 2:06:35 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
r19521 r19526 396 396 { 397 397 const char *psz = argv[i]; 398 if (*psz != '-') 399 return VBoxServiceSyntax("Unknown argument '%s'\n", psz); 400 psz++; 401 402 /* translate long argument to short */ 403 if (*psz == '-') 398 399 /* Translate long argument to short. */ 400 if (*psz+1 == '-') 404 401 { 405 402 psz++; … … 444 441 { 445 442 rc = g_aServices[j].pDesc->pfnOption(NULL, argc, argv, &i); 446 if (rc != 0) 443 fFound = rc == 0; 444 if (fFound) 445 break; 446 if (rc != -1) 447 447 return rc; 448 448 } … … 451 451 #undef MATCHES 452 452 } 453 454 /* handle the string of short options. */ 455 do 453 else if (*psz == '-') 456 454 { 457 switch (*psz) 455 /* Handle the string of short options. */ 456 do 458 457 { 459 case 'i': 460 rc = VBoxServiceArgUInt32(argc, argv, psz + 1, &i, 461 &g_DefaultInterval, 1, (UINT32_MAX / 1000) - 1); 462 if (rc) 463 return rc; 464 psz = NULL; 465 break; 466 467 case 'f': 468 fDaemonize = false; 469 break; 470 471 case 'v': 472 g_cVerbosity++; 473 break; 474 475 case 'h': 476 case '?': 477 return VBoxServiceUsage(); 478 479 #ifdef RT_OS_WINDOWS 480 case 'r': 481 return VBoxServiceWinInstall(); 482 483 case 'u': 484 return VBoxServiceWinUninstall(); 485 #endif 486 487 default: 458 switch (*psz) 488 459 { 489 for (unsigned j = 0; j < RT_ELEMENTS(g_aServices); j++) 460 case 'i': 461 rc = VBoxServiceArgUInt32(argc, argv, psz + 1, &i, 462 &g_DefaultInterval, 1, (UINT32_MAX / 1000) - 1); 463 if (rc) 464 return rc; 465 psz = NULL; 466 break; 467 468 case 'f': 469 fDaemonize = false; 470 break; 471 472 case 'v': 473 g_cVerbosity++; 474 break; 475 476 case 'h': 477 case '?': 478 return VBoxServiceUsage(); 479 480 #ifdef RT_OS_WINDOWS 481 case 'r': 482 return VBoxServiceWinInstall(); 483 484 case 'u': 485 return VBoxServiceWinUninstall(); 486 #endif 487 488 default: 490 489 { 491 rc = g_aServices[j].pDesc->pfnOption(&psz, argc, argv, &i); 492 if (rc != 0) 493 return rc; 490 bool fFound = false; 491 for (unsigned j = 0; j < RT_ELEMENTS(g_aServices); j++) 492 { 493 rc = g_aServices[j].pDesc->pfnOption(&psz, argc, argv, &i); 494 fFound = rc == 0; 495 if (fFound) 496 break; 497 if (rc != -1) 498 return rc; 499 } 500 break; 494 501 } 495 break;496 502 } 497 } 498 } while (psz && *++psz);503 } while (psz && *++psz); 504 } 499 505 } 500 506
Note:
See TracChangeset
for help on using the changeset viewer.