Changeset 26517 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Feb 14, 2010 9:39:00 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 57688
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp
r26498 r26517 33 33 *******************************************************************************/ 34 34 #include <VBox/sup.h> 35 #include <iprt/buildconfig.h> 35 36 #include <iprt/initterm.h> 36 37 #include <iprt/getopt.h> … … 79 80 { "--what", 'o', RTGETOPT_REQ_STRING }, 80 81 { "--which", 'l', RTGETOPT_REQ_STRING }, 81 { "--help", 'h', 0 },82 82 }; 83 83 … … 141 141 return usage(); 142 142 143 case 'V': 144 RTPrintf("%sr%s\n", RTBldCfgVersion(), RTBldCfgRevisionStr()); 145 return 0; 146 143 147 case VINF_GETOPT_NOT_OPTION: 144 148 RTStrmPrintf(g_pStdErr, "SUPLoggerCtl: error: Unexpected argument '%s'.\n", Val.psz); … … 146 150 147 151 default: 148 if (ch > 0) 149 { 150 if (RT_C_IS_GRAPH(ch)) 151 RTStrmPrintf(g_pStdErr, "SUPLoggerCtl: error: unhandled option: -%c\n", ch); 152 else 153 RTStrmPrintf(g_pStdErr, "SUPLoggerCtl: error: unhandled option: %i\n", ch); 154 } 155 else if (ch == VERR_GETOPT_UNKNOWN_OPTION) 156 RTStrmPrintf(g_pStdErr, "SUPLoggerCtl: error: unknown option: %s\n", Val.psz); 157 else if (Val.pDef) 158 RTStrmPrintf(g_pStdErr, "SUPLoggerCtl: error: %s: %Rrs\n", Val.pDef->pszLong, ch); 159 else 160 RTStrmPrintf(g_pStdErr, "SUPLoggerCtl: error: %Rrs\n", ch); 161 return 1; 152 return RTGetOptPrintError(ch, &Val); 162 153 } 163 154 } -
trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp
r22077 r26517 66 66 RTGETOPTUNION ValueUnion; 67 67 RTGETOPTSTATE GetState; 68 RTGetOptInit(&GetState, argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), 1, 0 /* fFlags */);68 RTGetOptInit(&GetState, argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), 1, RTGETOPTINIT_FLAGS_NO_STD_OPTS); 69 69 while ((ch = RTGetOpt(&GetState, &ValueUnion))) 70 70 { … … 87 87 break; 88 88 89 case VINF_GETOPT_NOT_OPTION:90 RTPrintf("tstGIP-2: syntax error: %s\n", ValueUnion.psz);91 return 1;92 93 89 default: 94 if (ch < 0) 95 RTPrintf("tstGIP-2: %Rrc: %s\n", ch, ValueUnion.psz); 96 else 97 RTPrintf("tstGIP-2: syntax error: %s\n", ValueUnion.psz); 98 return 1; 90 return RTGetOptPrintError(ch, &ValueUnion); 99 91 } 100 92 } -
trunk/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp
r26498 r26517 61 61 static const RTGETOPTDEF s_aOptions[] = 62 62 { 63 { "--help", 'h', 0 }63 { "--help", 'h', RTGETOPT_REQ_NOTHING } /* (dummy entry) */ 64 64 }; 65 65 … … 96 96 return 1; 97 97 98 case 'V': 99 RTPrintf("$Revision$\n"); 100 return 0; 101 98 102 default: 99 103 return RTGetOptPrintError(ch, &ValueUnion); -
trunk/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp
r22077 r26517 270 270 RTGETOPTUNION Value; 271 271 RTGETOPTSTATE GetState; 272 RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 0, 0 /* fFlags*/);272 RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 0, RTGETOPTINIT_FLAGS_NO_STD_OPTS); 273 273 while ((ch = RTGetOpt(&GetState, &Value))) 274 274 switch (ch)
Note:
See TracChangeset
for help on using the changeset viewer.