Changeset 26517 in vbox for trunk/src/VBox/Main/webservice
- Timestamp:
- Feb 14, 2010 9:39:00 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 57688
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/webservice/vboxweb.cpp
r26450 r26517 32 32 #include <VBox/version.h> 33 33 34 #include <iprt/buildconfig.h> 34 35 #include <iprt/thread.h> 35 36 #include <iprt/rand.h> … … 143 144 static const RTGETOPTDEF g_aOptions[] 144 145 = { 145 { "--help", 'h', RTGETOPT_REQ_NOTHING }, 146 { "--help", 'h', RTGETOPT_REQ_NOTHING }, /* for DisplayHelp() */ 146 147 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined (RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 147 148 { "--background", 'b', RTGETOPT_REQ_NOTHING }, … … 588 589 RTGETOPTUNION ValueUnion; 589 590 RTGETOPTSTATE GetState; 590 RTGetOptInit(&GetState, argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), 1, 0 /* fFlags*/);591 RTGetOptInit(&GetState, argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), 1, 0 /*fFlags*/); 591 592 while ((c = RTGetOpt(&GetState, &ValueUnion))) 592 593 { … … 629 630 case 'h': 630 631 DisplayHelp(); 631 exit(0); 632 break; 632 return 0; 633 633 634 634 case 'v': … … 641 641 break; 642 642 #endif 643 case VINF_GETOPT_NOT_OPTION:644 RT StrmPrintf(g_pStdErr, "unhandled parameter: %s\n", ValueUnion.psz);645 return 1;643 case 'V': 644 RTPrintf("%sr%s\n", RTBldCfgVersion(), RTBldCfgRevisionStr()); 645 return 0; 646 646 647 647 default: 648 if (c > 0) 649 { 650 if (RT_C_IS_GRAPH(c)) 651 RTStrmPrintf(g_pStdErr, "unhandled option: -%c", c); 652 else 653 RTStrmPrintf(g_pStdErr, "unhandled option: %i", c); 654 } 655 else if (c == VERR_GETOPT_UNKNOWN_OPTION) 656 RTStrmPrintf(g_pStdErr, "unknown option: %s", ValueUnion.psz); 657 else if (ValueUnion.pDef) 658 RTStrmPrintf(g_pStdErr, "%s: %Rrs", ValueUnion.pDef->pszLong, c); 659 else 660 RTStrmPrintf(g_pStdErr, "%Rrs", c); 661 exit(1); 662 break; 648 rc = RTGetOptPrintError(c, &ValueUnion); 649 return rc; 663 650 } 664 651 }
Note:
See TracChangeset
for help on using the changeset viewer.