Changeset 77595 in vbox for trunk/src/VBox
- Timestamp:
- Mar 7, 2019 12:42:31 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r76553 r77595 135 135 * Print the usage info. 136 136 */ 137 void printUsageInternal(USAGECATEGORY u64Cmd, PRTSTREAM pStrm) 138 { 137 void printUsageInternal(USAGECATEGORY enmCommand, PRTSTREAM pStrm) 138 { 139 Assert(enmCommand != USAGE_INVALID); 140 Assert(enmCommand != USAGE_S_NEWCMD); 141 Assert(enmCommand != USAGE_S_DUMPOPTS); 139 142 RTStrmPrintf(pStrm, 140 143 "Usage: VBoxManage internalcommands <command> [command arguments]\n" … … 147 150 " incompatible ways without warning.\n", 148 151 149 ( u64Cmd & USAGE_LOADMAP)152 (enmCommand == USAGE_I_LOADMAP || enmCommand == USAGE_S_ALL) 150 153 ? " loadmap <vmname|uuid> <symfile> <address> [module] [subtrahend] [segment]\n" 151 154 " This will instruct DBGF to load the given map file\n" … … 153 156 "\n" 154 157 : "", 155 ( u64Cmd & USAGE_LOADSYMS)158 (enmCommand == USAGE_I_LOADSYMS || enmCommand == USAGE_S_ALL) 156 159 ? " loadsyms <vmname|uuid> <symfile> [delta] [module] [module address]\n" 157 160 " This will instruct DBGF to load the given symbol file\n" … … 159 162 "\n" 160 163 : "", 161 ( u64Cmd & USAGE_SETHDUUID)164 (enmCommand == USAGE_I_SETHDUUID || enmCommand == USAGE_S_ALL) 162 165 ? " sethduuid <filepath> [<uuid>]\n" 163 166 " Assigns a new UUID to the given image file. This way, multiple copies\n" … … 165 168 "\n" 166 169 : "", 167 ( u64Cmd & USAGE_SETHDPARENTUUID)170 (enmCommand == USAGE_I_SETHDPARENTUUID || enmCommand == USAGE_S_ALL) 168 171 ? " sethdparentuuid <filepath> <uuid>\n" 169 172 " Assigns a new parent UUID to the given image file.\n" 170 173 "\n" 171 174 : "", 172 ( u64Cmd & USAGE_DUMPHDINFO)175 (enmCommand == USAGE_I_DUMPHDINFO || enmCommand == USAGE_S_ALL) 173 176 ? " dumphdinfo <filepath>\n" 174 177 " Prints information about the image at the given location.\n" 175 178 "\n" 176 179 : "", 177 ( u64Cmd & USAGE_LISTPARTITIONS)180 (enmCommand == USAGE_I_LISTPARTITIONS || enmCommand == USAGE_S_ALL) 178 181 ? " listpartitions -rawdisk <diskname>\n" 179 182 " Lists all partitions on <diskname>.\n" 180 183 "\n" 181 184 : "", 182 ( u64Cmd & USAGE_CREATERAWVMDK)185 (enmCommand == USAGE_I_CREATERAWVMDK || enmCommand == USAGE_S_ALL) 183 186 ? " createrawvmdk -filename <filename> -rawdisk <diskname>\n" 184 187 " [-partitions <list of partition numbers> [-mbr <filename>] ]\n" … … 198 201 "\n" 199 202 : "", 200 ( u64Cmd & USAGE_RENAMEVMDK)203 (enmCommand == USAGE_I_RENAMEVMDK || enmCommand == USAGE_S_ALL) 201 204 ? " renamevmdk -from <filename> -to <filename>\n" 202 205 " Renames an existing VMDK image, including the base file and all its extents.\n" 203 206 "\n" 204 207 : "", 205 ( u64Cmd & USAGE_CONVERTTORAW)208 (enmCommand == USAGE_I_CONVERTTORAW || enmCommand == USAGE_S_ALL) 206 209 ? " converttoraw [-format <fileformat>] <filename> <outputfile>" 207 210 #ifdef ENABLE_CONVERT_RAW_TO_STDOUT … … 216 219 "\n" 217 220 : "", 218 ( u64Cmd & USAGE_CONVERTHD)221 (enmCommand == USAGE_I_CONVERTHD || enmCommand == USAGE_S_ALL) 219 222 ? " converthd [-srcformat VDI|VMDK|VHD|RAW]\n" 220 223 " [-dstformat VDI|VMDK|VHD|RAW]\n" … … 223 226 "\n" 224 227 : "", 225 ( u64Cmd & USAGE_REPAIRHD)228 (enmCommand == USAGE_I_REPAIRHD || enmCommand == USAGE_S_ALL) 226 229 ? " repairhd [-dry-run]\n" 227 230 " [-format VDI|VMDK|VHD|...]\n" … … 231 234 : "", 232 235 #ifdef RT_OS_WINDOWS 233 ( u64Cmd & USAGE_MODINSTALL)236 (enmCommand == USAGE_I_MODINSTALL || enmCommand == USAGE_S_ALL) 234 237 ? " modinstall\n" 235 238 " Installs the necessary driver for the host OS\n" 236 239 "\n" 237 240 : "", 238 ( u64Cmd & USAGE_MODUNINSTALL)241 (enmCommand == USAGE_I_MODUNINSTALL || enmCommand == USAGE_S_ALL) 239 242 ? " moduninstall\n" 240 243 " Deinstalls the driver\n" … … 245 248 "", 246 249 #endif 247 ( u64Cmd & USAGE_DEBUGLOG)250 (enmCommand == USAGE_I_DEBUGLOG || enmCommand == USAGE_S_ALL) 248 251 ? " debuglog <vmname|uuid> [--enable|--disable] [--flags todo]\n" 249 252 " [--groups todo] [--destinations todo]\n" … … 251 254 "\n" 252 255 : "", 253 ( u64Cmd & USAGE_PASSWORDHASH)254 ? " passwordhash <pass sword>\n"256 (enmCommand == USAGE_I_PASSWORDHASH || enmCommand == USAGE_S_ALL) 257 ? " passwordhash <password>\n" 255 258 " Generates a password hash.\n" 256 259 "\n" 257 260 : "", 258 ( u64Cmd & USAGE_GUESTSTATS)261 (enmCommand == USAGE_I_GUESTSTATS || enmCommand == USAGE_S_ALL) 259 262 ? " gueststats <vmname|uuid> [--interval <seconds>]\n" 260 263 " Obtains and prints internal guest statistics.\n" … … 627 630 uuidType = HDUUID; 628 631 if (argc != 3 && argc != 2) 629 return errorSyntax(USAGE_ SETHDUUID, "Not enough parameters");632 return errorSyntax(USAGE_I_SETHDUUID, "Not enough parameters"); 630 633 /* if specified, take UUID, otherwise generate a new one */ 631 634 if (argc == 3) 632 635 { 633 636 if (RT_FAILURE(RTUuidFromStr(&rtuuid, argv[2]))) 634 return errorSyntax(USAGE_ SETHDUUID, "Invalid UUID parameter");637 return errorSyntax(USAGE_I_SETHDUUID, "Invalid UUID parameter"); 635 638 uuid = argv[2]; 636 639 } else … … 641 644 uuidType = HDPARENTUUID; 642 645 if (argc != 3) 643 return errorSyntax(USAGE_ SETHDPARENTUUID, "Not enough parameters");646 return errorSyntax(USAGE_I_SETHDPARENTUUID, "Not enough parameters"); 644 647 if (RT_FAILURE(RTUuidFromStr(&rtuuid, argv[2]))) 645 return errorSyntax(USAGE_ SETHDPARENTUUID, "Invalid UUID parameter");648 return errorSyntax(USAGE_I_SETHDPARENTUUID, "Invalid UUID parameter"); 646 649 uuid = argv[2]; 647 650 } 648 651 else 649 return errorSyntax(USAGE_ SETHDUUID, "Invalid invocation");652 return errorSyntax(USAGE_I_SETHDUUID, "Invalid invocation"); 650 653 651 654 /* just try it */ … … 699 702 if (argc != 1) 700 703 { 701 return errorSyntax(USAGE_ DUMPHDINFO, "Not enough parameters");704 return errorSyntax(USAGE_I_DUMPHDINFO, "Not enough parameters"); 702 705 } 703 706 … … 1093 1096 else 1094 1097 { 1095 return errorSyntax(USAGE_ LISTPARTITIONS, "Invalid parameter '%s'", argv[i]);1098 return errorSyntax(USAGE_I_LISTPARTITIONS, "Invalid parameter '%s'", argv[i]); 1096 1099 } 1097 1100 } 1098 1101 1099 1102 if (rawdisk.isEmpty()) 1100 return errorSyntax(USAGE_ LISTPARTITIONS, "Mandatory parameter -rawdisk missing");1103 return errorSyntax(USAGE_I_LISTPARTITIONS, "Mandatory parameter -rawdisk missing"); 1101 1104 1102 1105 RTFILE hRawFile; … … 1210 1213 #endif /* RT_OS_LINUX || RT_OS_FREEBSD */ 1211 1214 else 1212 return errorSyntax(USAGE_ CREATERAWVMDK, "Invalid parameter '%s'", argv[i]);1215 return errorSyntax(USAGE_I_CREATERAWVMDK, "Invalid parameter '%s'", argv[i]); 1213 1216 } 1214 1217 1215 1218 if (filename.isEmpty()) 1216 return errorSyntax(USAGE_ CREATERAWVMDK, "Mandatory parameter -filename missing");1219 return errorSyntax(USAGE_I_CREATERAWVMDK, "Mandatory parameter -filename missing"); 1217 1220 if (rawdisk.isEmpty()) 1218 return errorSyntax(USAGE_ CREATERAWVMDK, "Mandatory parameter -rawdisk missing");1221 return errorSyntax(USAGE_I_CREATERAWVMDK, "Mandatory parameter -rawdisk missing"); 1219 1222 if (!pszPartitions && pszMBRFilename) 1220 return errorSyntax(USAGE_ CREATERAWVMDK, "The parameter -mbr is only valid when the parameter -partitions is also present");1223 return errorSyntax(USAGE_I_CREATERAWVMDK, "The parameter -mbr is only valid when the parameter -partitions is also present"); 1221 1224 1222 1225 #ifdef RT_OS_DARWIN … … 1897 1900 else 1898 1901 { 1899 return errorSyntax(USAGE_ RENAMEVMDK, "Invalid parameter '%s'", argv[i]);1902 return errorSyntax(USAGE_I_RENAMEVMDK, "Invalid parameter '%s'", argv[i]); 1900 1903 } 1901 1904 } 1902 1905 1903 1906 if (src.isEmpty()) 1904 return errorSyntax(USAGE_ RENAMEVMDK, "Mandatory parameter -from missing");1907 return errorSyntax(USAGE_I_RENAMEVMDK, "Mandatory parameter -from missing"); 1905 1908 if (dst.isEmpty()) 1906 return errorSyntax(USAGE_ RENAMEVMDK, "Mandatory parameter -to missing");1909 return errorSyntax(USAGE_I_RENAMEVMDK, "Mandatory parameter -to missing"); 1907 1910 1908 1911 PVDISK pDisk = NULL; … … 1970 1973 else 1971 1974 { 1972 return errorSyntax(USAGE_ CONVERTTORAW, "Invalid parameter '%s'", argv[i]);1975 return errorSyntax(USAGE_I_CONVERTTORAW, "Invalid parameter '%s'", argv[i]); 1973 1976 } 1974 1977 } 1975 1978 1976 1979 if (src.isEmpty()) 1977 return errorSyntax(USAGE_ CONVERTTORAW, "Mandatory filename parameter missing");1980 return errorSyntax(USAGE_I_CONVERTTORAW, "Mandatory filename parameter missing"); 1978 1981 if (dst.isEmpty()) 1979 return errorSyntax(USAGE_ CONVERTTORAW, "Mandatory outputfile parameter missing");1982 return errorSyntax(USAGE_I_CONVERTTORAW, "Mandatory outputfile parameter missing"); 1980 1983 1981 1984 PVDISK pDisk = NULL; … … 2135 2138 else 2136 2139 { 2137 return errorSyntax(USAGE_ CONVERTHD, "Invalid parameter '%s'", argv[i]);2140 return errorSyntax(USAGE_I_CONVERTHD, "Invalid parameter '%s'", argv[i]); 2138 2141 } 2139 2142 } 2140 2143 2141 2144 if (src.isEmpty()) 2142 return errorSyntax(USAGE_ CONVERTHD, "Mandatory input image parameter missing");2145 return errorSyntax(USAGE_I_CONVERTHD, "Mandatory input image parameter missing"); 2143 2146 if (dst.isEmpty()) 2144 return errorSyntax(USAGE_ CONVERTHD, "Mandatory output image parameter missing");2147 return errorSyntax(USAGE_I_CONVERTHD, "Mandatory output image parameter missing"); 2145 2148 2146 2149 … … 2254 2257 else 2255 2258 { 2256 return errorSyntax(USAGE_ REPAIRHD, "Invalid parameter '%s'", argv[i]);2259 return errorSyntax(USAGE_I_REPAIRHD, "Invalid parameter '%s'", argv[i]); 2257 2260 } 2258 2261 } 2259 2262 2260 2263 if (image.isEmpty()) 2261 return errorSyntax(USAGE_ REPAIRHD, "Mandatory input image parameter missing");2264 return errorSyntax(USAGE_I_REPAIRHD, "Mandatory input image parameter missing"); 2262 2265 2263 2266 PVDINTERFACE pVDIfs = NULL; … … 2333 2336 */ 2334 2337 if (argc < 1) 2335 return errorSyntax(USAGE_ DEBUGLOG, "Missing VM name/UUID");2338 return errorSyntax(USAGE_I_DEBUGLOG, "Missing VM name/UUID"); 2336 2339 2337 2340 ComPtr<IMachine> ptrMachine; … … 2421 2424 2422 2425 default: 2423 return errorGetOpt(USAGE_ DEBUGLOG, ch, &ValueUnion);2426 return errorGetOpt(USAGE_I_DEBUGLOG, ch, &ValueUnion); 2424 2427 } 2425 2428 } … … 2449 2452 /* one parameter, the password to hash */ 2450 2453 if (argc != 1) 2451 return errorSyntax(USAGE_ PASSWORDHASH, "password to hash required");2454 return errorSyntax(USAGE_I_PASSWORDHASH, "password to hash required"); 2452 2455 2453 2456 uint8_t abDigest[RTSHA256_HASH_SIZE]; … … 2468 2471 /* one parameter, guest name */ 2469 2472 if (argc < 1) 2470 return errorSyntax(USAGE_ GUESTSTATS, "Missing VM name/UUID");2473 return errorSyntax(USAGE_I_GUESTSTATS, "Missing VM name/UUID"); 2471 2474 2472 2475 /* … … 2493 2496 2494 2497 default: 2495 return errorGetOpt(USAGE_ GUESTSTATS, ch, &ValueUnion);2498 return errorGetOpt(USAGE_I_GUESTSTATS, ch, &ValueUnion); 2496 2499 } 2497 2500 } 2498 2501 2499 2502 if (argc > 1 && aUpdateInterval == 0) 2500 return errorSyntax(USAGE_ GUESTSTATS, "Invalid update interval specified");2503 return errorSyntax(USAGE_I_GUESTSTATS, "Invalid update interval specified"); 2501 2504 2502 2505 RTPrintf("argc=%d interval=%u\n", argc, aUpdateInterval); … … 2553 2556 /* at least a command is required */ 2554 2557 if (a->argc < 1) 2555 return errorSyntax(USAGE_ ALL, "Command missing");2558 return errorSyntax(USAGE_S_ALL, "Command missing"); 2556 2559 2557 2560 /* … … 2593 2596 2594 2597 /* default: */ 2595 return errorSyntax(USAGE_ ALL, "Invalid command '%s'", a->argv[0]);2598 return errorSyntax(USAGE_S_ALL, "Invalid command '%s'", a->argv[0]); 2596 2599 } 2597 2600 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r76553 r77595 98 98 static const VBMGCMD g_aCommands[] = 99 99 { 100 { "internalcommands", 0,VBMG_CMD_TODO, handleInternalCommands, 0 },100 { "internalcommands", USAGE_INVALID, VBMG_CMD_TODO, handleInternalCommands, 0 }, 101 101 { "list", USAGE_LIST, VBMG_CMD_TODO, handleList, 0 }, 102 102 { "showvminfo", USAGE_SHOWVMINFO, VBMG_CMD_TODO, handleShowVMInfo, 0 }, … … 122 122 { "startvm", USAGE_STARTVM, VBMG_CMD_TODO, handleStartVM, 0 }, 123 123 { "controlvm", USAGE_CONTROLVM, VBMG_CMD_TODO, handleControlVM, 0 }, 124 { "unattended", USAGE_ UNATTENDED, HELP_CMD_UNATTENDED, handleUnattended,0 },124 { "unattended", USAGE_S_NEWCMD, HELP_CMD_UNATTENDED, handleUnattended, 0 }, 125 125 { "discardstate", USAGE_DISCARDSTATE, VBMG_CMD_TODO, handleDiscardState, 0 }, 126 126 { "adoptstate", USAGE_ADOPTSTATE, VBMG_CMD_TODO, handleAdoptState, 0 }, … … 132 132 { "showhdinfo", USAGE_SHOWMEDIUMINFO, VBMG_CMD_TODO, handleShowMediumInfo, 0 }, /* backward compatibility */ 133 133 { "showvdiinfo", USAGE_SHOWMEDIUMINFO, VBMG_CMD_TODO, handleShowMediumInfo, 0 }, /* backward compatibility */ 134 { "mediumio", USAGE_ MEDIUMIO, HELP_CMD_MEDIUMIO, handleMediumIO, 0 },134 { "mediumio", USAGE_S_NEWCMD, HELP_CMD_MEDIUMIO, handleMediumIO, 0 }, 135 135 { "getextradata", USAGE_GETEXTRADATA, VBMG_CMD_TODO, handleGetExtraData, 0 }, 136 136 { "setextradata", USAGE_SETEXTRADATA, VBMG_CMD_TODO, handleSetExtraData, 0 }, … … 154 154 { "natnetwork", USAGE_NATNETWORK, VBMG_CMD_TODO, handleNATNetwork, 0 }, 155 155 #endif 156 { "extpack", USAGE_ EXTPACK,HELP_CMD_EXTPACK, handleExtPack, 0 },156 { "extpack", USAGE_S_NEWCMD, HELP_CMD_EXTPACK, handleExtPack, 0 }, 157 157 { "bandwidthctl", USAGE_BANDWIDTHCONTROL, VBMG_CMD_TODO, handleBandwidthControl, 0 }, 158 { "debugvm", USAGE_ DEBUGVM,HELP_CMD_DEBUGVM, handleDebugVM, 0 },158 { "debugvm", USAGE_S_NEWCMD, HELP_CMD_DEBUGVM, handleDebugVM, 0 }, 159 159 { "convertfromraw", USAGE_CONVERTFROMRAW, VBMG_CMD_TODO, handleConvertFromRaw, VBMG_CMD_F_NO_COM }, 160 160 { "convertdd", USAGE_CONVERTFROMRAW, VBMG_CMD_TODO, handleConvertFromRaw, VBMG_CMD_F_NO_COM }, … … 497 497 { 498 498 showLogo(g_pStdOut); 499 printUsage(USAGE_ ALL, ~0U, g_pStdOut);499 printUsage(USAGE_S_ALL, RTMSGREFENTRYSTR_SCOPE_GLOBAL, g_pStdOut); 500 500 return 0; 501 501 } … … 524 524 /* Special option to dump really all commands, 525 525 * even the ones not understood on this platform. */ 526 printUsage(USAGE_ DUMPOPTS, ~0U, g_pStdOut);526 printUsage(USAGE_S_DUMPOPTS, RTMSGREFENTRYSTR_SCOPE_GLOBAL, g_pStdOut); 527 527 return 0; 528 528 } … … 619 619 && ( fShowHelp 620 620 || ( argc - iCmdArg == 0 621 && pCmd->enmHelpCat != 0)))621 && pCmd->enmHelpCat != USAGE_INVALID))) 622 622 { 623 623 if (pCmd->enmCmdHelp == VBMG_CMD_TODO) 624 printUsage(pCmd->enmHelpCat, ~0U, g_pStdOut);624 printUsage(pCmd->enmHelpCat, RTMSGREFENTRYSTR_SCOPE_GLOBAL, g_pStdOut); 625 625 else if (fShowHelp) 626 626 printHelp(g_pStdOut); … … 636 636 for (unsigned i = 0; i < RT_ELEMENTS(g_aCommands); i++) 637 637 if ( i == 0 /* skip backwards compatibility entries */ 638 || g_aCommands[i].enmHelpCat != g_aCommands[i - 1].enmHelpCat) 638 || (g_aCommands[i].enmHelpCat != USAGE_S_NEWCMD 639 ? g_aCommands[i].enmHelpCat != g_aCommands[i - 1].enmHelpCat 640 : g_aCommands[i].enmCmdHelp != g_aCommands[i - 1].enmCmdHelp)) 639 641 RTPrintf(" %s\n", g_aCommands[i].pszCommand); 640 642 return RTEXITCODE_SUCCESS; 641 643 } 642 return errorSyntax(USAGE_ ALL, "Invalid command '%s'", argv[iCmd]);644 return errorSyntax(USAGE_S_ALL, "Invalid command '%s'", argv[iCmd]); 643 645 } 644 646 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r76582 r77595 46 46 //////////////////////////////////////////////////////////////////////////////// 47 47 48 /** @name Syntax diagram category .48 /** @name Syntax diagram category, i.e. the command. 49 49 * @{ */ 50 #define USAGE_DUMPOPTS 0 51 #define USAGE_LIST RT_BIT_64(0) 52 #define USAGE_SHOWVMINFO RT_BIT_64(1) 53 #define USAGE_REGISTERVM RT_BIT_64(2) 54 #define USAGE_UNREGISTERVM RT_BIT_64(3) 55 #define USAGE_CREATEVM RT_BIT_64(4) 56 #define USAGE_MODIFYVM RT_BIT_64(5) 57 #define USAGE_CLONEVM RT_BIT_64(6) 58 #define USAGE_STARTVM RT_BIT_64(7) 59 #define USAGE_CONTROLVM RT_BIT_64(8) 60 #define USAGE_DISCARDSTATE RT_BIT_64(9) 61 #define USAGE_SNAPSHOT RT_BIT_64(10) 62 #define USAGE_CLOSEMEDIUM RT_BIT_64(11) 63 #define USAGE_SHOWMEDIUMINFO RT_BIT_64(12) 64 #define USAGE_CREATEMEDIUM RT_BIT_64(13) 65 #define USAGE_MODIFYMEDIUM RT_BIT_64(14) 66 #define USAGE_CLONEMEDIUM RT_BIT_64(15) 67 #define USAGE_MOVEVM RT_BIT_64(16) 68 #define USAGE_CREATEHOSTIF RT_BIT_64(17) 69 #define USAGE_REMOVEHOSTIF RT_BIT_64(18) 70 #define USAGE_GETEXTRADATA RT_BIT_64(19) 71 #define USAGE_SETEXTRADATA RT_BIT_64(20) 72 #define USAGE_SETPROPERTY RT_BIT_64(21) 73 #define USAGE_USBFILTER (RT_BIT_64(22) | RT_BIT_64(23) | RT_BIT_64(24)) 74 #define USAGE_USBFILTER_ADD RT_BIT_64(22) 75 #define USAGE_USBFILTER_MODIFY RT_BIT_64(23) 76 #define USAGE_USBFILTER_REMOVE RT_BIT_64(24) 77 #define USAGE_SHAREDFOLDER (RT_BIT_64(25) | RT_BIT_64(26)) 78 #define USAGE_SHAREDFOLDER_ADD RT_BIT_64(25) 79 #define USAGE_SHAREDFOLDER_REMOVE RT_BIT_64(26) 80 #define USAGE_UNATTENDED RT_BIT_64(27) 81 #define USAGE_MEDIUMIO RT_BIT_64(28) 82 #define USAGE_LOADSYMS RT_BIT_64(29) 83 #define USAGE_LOADMAP RT_BIT_64(30) 84 #define USAGE_SETHDUUID RT_BIT_64(31) 85 #define USAGE_CONVERTFROMRAW RT_BIT_64(32) 86 #define USAGE_LISTPARTITIONS RT_BIT_64(33) 87 #define USAGE_CREATERAWVMDK RT_BIT_64(34) 88 #define USAGE_DEBUGVM RT_BIT_64(35) 89 #define USAGE_ADOPTSTATE RT_BIT_64(36) 90 #define USAGE_MODINSTALL RT_BIT_64(37) 91 #define USAGE_MODUNINSTALL RT_BIT_64(38) 92 #define USAGE_RENAMEVMDK RT_BIT_64(39) 50 typedef enum 51 { 52 USAGE_INVALID = 0, 53 USAGE_LIST, 54 USAGE_SHOWVMINFO, 55 USAGE_REGISTERVM, 56 USAGE_UNREGISTERVM, 57 USAGE_CREATEVM, 58 USAGE_MODIFYVM, 59 USAGE_CLONEVM, 60 USAGE_STARTVM, 61 USAGE_CONTROLVM, 62 USAGE_DISCARDSTATE, 63 USAGE_SNAPSHOT, 64 USAGE_CLOSEMEDIUM, 65 USAGE_SHOWMEDIUMINFO, 66 USAGE_CREATEMEDIUM, 67 USAGE_MODIFYMEDIUM, 68 USAGE_CLONEMEDIUM, 69 USAGE_MOVEVM, 70 USAGE_CREATEHOSTIF, 71 USAGE_REMOVEHOSTIF, 72 USAGE_GETEXTRADATA, 73 USAGE_SETEXTRADATA, 74 USAGE_SETPROPERTY, 75 USAGE_USBFILTER, 76 USAGE_SHAREDFOLDER, 77 USAGE_I_LOADSYMS, 78 USAGE_I_LOADMAP, 79 USAGE_I_SETHDUUID, 80 USAGE_CONVERTFROMRAW, 81 USAGE_I_LISTPARTITIONS, 82 USAGE_I_CREATERAWVMDK, 83 USAGE_ADOPTSTATE, 84 USAGE_I_MODINSTALL, 85 USAGE_I_MODUNINSTALL, 86 USAGE_I_RENAMEVMDK, 93 87 #ifdef VBOX_WITH_GUEST_PROPS 94 # define USAGE_GUESTPROPERTY RT_BIT_64(40) 88 USAGE_GUESTPROPERTY, 95 89 #endif /* VBOX_WITH_GUEST_PROPS defined */ 96 #define USAGE_CONVERTTORAW RT_BIT_64(41) 97 #define USAGE_METRICS RT_BIT_64(42) 98 #define USAGE_CONVERTHD RT_BIT_64(43) 99 #define USAGE_IMPORTAPPLIANCE RT_BIT_64(44) 100 #define USAGE_EXPORTAPPLIANCE RT_BIT_64(45) 101 #define USAGE_HOSTONLYIFS RT_BIT_64(46) 102 #define USAGE_DHCPSERVER RT_BIT_64(47) 103 #define USAGE_DUMPHDINFO RT_BIT_64(48) 104 #define USAGE_STORAGEATTACH RT_BIT_64(49) 105 #define USAGE_STORAGECONTROLLER RT_BIT_64(50) 90 USAGE_I_CONVERTTORAW, 91 USAGE_METRICS, 92 USAGE_I_CONVERTHD, 93 USAGE_IMPORTAPPLIANCE, 94 USAGE_EXPORTAPPLIANCE, 95 USAGE_HOSTONLYIFS, 96 USAGE_DHCPSERVER, 97 USAGE_I_DUMPHDINFO, 98 USAGE_STORAGEATTACH, 99 USAGE_STORAGECONTROLLER, 106 100 #ifdef VBOX_WITH_GUEST_CONTROL 107 # define USAGE_GUESTCONTROL RT_BIT_64(51) 101 USAGE_GUESTCONTROL, 108 102 #endif /* VBOX_WITH_GUEST_CONTROL defined */ 109 #define USAGE_DEBUGLOG RT_BIT_64(52) 110 #define USAGE_SETHDPARENTUUID RT_BIT_64(53) 111 #define USAGE_PASSWORDHASH RT_BIT_64(54) 112 #define USAGE_EXTPACK RT_BIT_64(55) 113 #define USAGE_BANDWIDTHCONTROL RT_BIT_64(56) 114 #define USAGE_GUESTSTATS RT_BIT_64(57) 115 #define USAGE_REPAIRHD RT_BIT_64(58) 116 #define USAGE_NATNETWORK RT_BIT_64(59) 117 #define USAGE_MEDIUMPROPERTY RT_BIT_64(60) 118 #define USAGE_ENCRYPTMEDIUM RT_BIT_64(61) 119 #define USAGE_MEDIUMENCCHKPWD RT_BIT_64(62) 120 #define USAGE_USBDEVSOURCE RT_BIT_64(63) 121 #define USAGE_ALL (~(uint64_t)0) 103 USAGE_I_DEBUGLOG, 104 USAGE_I_SETHDPARENTUUID, 105 USAGE_I_PASSWORDHASH, 106 USAGE_BANDWIDTHCONTROL, 107 USAGE_I_GUESTSTATS, 108 USAGE_I_REPAIRHD, 109 USAGE_NATNETWORK, 110 USAGE_MEDIUMPROPERTY, 111 USAGE_ENCRYPTMEDIUM, 112 USAGE_MEDIUMENCCHKPWD, 113 USAGE_USBDEVSOURCE, 114 /* Insert new entries before this line, but only if it is not an option 115 * to go for the new style command and help handling (see e.g. extpack, 116 * unattend or mediumio. */ 117 USAGE_S_NEWCMD = 10000, /**< new style command with no old help support */ 118 USAGE_S_ALL, 119 USAGE_S_DUMPOPTS 120 } USAGECATEGORY; 122 121 /** @} */ 123 122 123 124 #define HELP_SCOPE_USBFILTER_ADD RT_BIT_64(0) 125 #define HELP_SCOPE_USBFILTER_MODIFY RT_BIT_64(1) 126 #define HELP_SCOPE_USBFILTER_REMOVE RT_BIT_64(2) 127 128 #define HELP_SCOPE_SHAREDFOLDER_ADD RT_BIT_64(0) 129 #define HELP_SCOPE_SHAREDFOLDER_REMOVE RT_BIT_64(1) 130 124 131 #ifdef VBOX_WITH_GUEST_CONTROL 125 # define USAGE_GSTCTRL_RUN RT_BIT(0) 126 # define USAGE_GSTCTRL_START RT_BIT(1) 127 # define USAGE_GSTCTRL_COPYFROM RT_BIT(2) 128 # define USAGE_GSTCTRL_COPYTO RT_BIT(3) 129 # define USAGE_GSTCTRL_MKDIR RT_BIT(4) 130 # define USAGE_GSTCTRL_RMDIR RT_BIT(5) 131 # define USAGE_GSTCTRL_RM RT_BIT(6) 132 # define USAGE_GSTCTRL_MV RT_BIT(7) 133 # define USAGE_GSTCTRL_MKTEMP RT_BIT(8) 134 # define USAGE_GSTCTRL_LIST RT_BIT(9) 135 # define USAGE_GSTCTRL_CLOSEPROCESS RT_BIT(10) 136 # define USAGE_GSTCTRL_CLOSESESSION RT_BIT(11) 137 # define USAGE_GSTCTRL_STAT RT_BIT(12) 138 # define USAGE_GSTCTRL_UPDATEGA RT_BIT(13) 139 # define USAGE_GSTCTRL_WATCH RT_BIT(14) 140 #endif 141 142 143 typedef uint64_t USAGECATEGORY; 132 # define HELP_SCOPE_GSTCTRL_RUN RT_BIT(0) 133 # define HELP_SCOPE_GSTCTRL_START RT_BIT(1) 134 # define HELP_SCOPE_GSTCTRL_COPYFROM RT_BIT(2) 135 # define HELP_SCOPE_GSTCTRL_COPYTO RT_BIT(3) 136 # define HELP_SCOPE_GSTCTRL_MKDIR RT_BIT(4) 137 # define HELP_SCOPE_GSTCTRL_RMDIR RT_BIT(5) 138 # define HELP_SCOPE_GSTCTRL_RM RT_BIT(6) 139 # define HELP_SCOPE_GSTCTRL_MV RT_BIT(7) 140 # define HELP_SCOPE_GSTCTRL_MKTEMP RT_BIT(8) 141 # define HELP_SCOPE_GSTCTRL_LIST RT_BIT(9) 142 # define HELP_SCOPE_GSTCTRL_CLOSEPROCESS RT_BIT(10) 143 # define HELP_SCOPE_GSTCTRL_CLOSESESSION RT_BIT(11) 144 # define HELP_SCOPE_GSTCTRL_STAT RT_BIT(12) 145 # define HELP_SCOPE_GSTCTRL_UPDATEGA RT_BIT(13) 146 # define HELP_SCOPE_GSTCTRL_WATCH RT_BIT(14) 147 #endif 148 144 149 145 150 /** command handler argument */ … … 185 190 186 191 /* VBoxManageHelp.cpp */ 187 void printUsage(USAGECATEGORY fCategory, uint32_t fSubCategory, PRTSTREAM pStrm); 188 RTEXITCODE errorSyntax(USAGECATEGORY fCategory, const char *pszFormat, ...); 189 RTEXITCODE errorSyntaxEx(USAGECATEGORY fCategory, uint32_t fSubCategory, const char *pszFormat, ...); 190 RTEXITCODE errorGetOpt(USAGECATEGORY fCategory, int rc, union RTGETOPTUNION const *pValueUnion); 191 RTEXITCODE errorGetOptEx(USAGECATEGORY fCategory, uint32_t fSubCategory, int rc, union RTGETOPTUNION const *pValueUnion); 192 193 /* Legacy help infrastructure, to be replaced by new one using generated help. */ 194 void printUsage(USAGECATEGORY enmCommand, uint64_t fSubcommandScope, PRTSTREAM pStrm); 195 RTEXITCODE errorSyntax(USAGECATEGORY enmCommand, const char *pszFormat, ...); 196 RTEXITCODE errorSyntaxEx(USAGECATEGORY enmCommand, uint64_t fSubcommandScope, const char *pszFormat, ...); 197 RTEXITCODE errorGetOpt(USAGECATEGORY enmCommand, int rc, union RTGETOPTUNION const *pValueUnion); 198 RTEXITCODE errorGetOptEx(USAGECATEGORY enmCommand, uint64_t fSubcommandScope, int rc, union RTGETOPTUNION const *pValueUnion); 192 199 RTEXITCODE errorArgument(const char *pszFormat, ...); 193 200 194 void printUsageInternal(USAGECATEGORY fCategory, PRTSTREAM pStrm);201 void printUsageInternal(USAGECATEGORY enmCommand, PRTSTREAM pStrm); 195 202 196 203 #ifndef VBOX_ONLY_DOCS … … 238 245 239 246 /* VBoxManageGuestCtrl.cpp */ 240 extern void usageGuestControl(PRTSTREAM pStrm, const char *pcszSep1, const char *pcszSep2, uint 32_t fSubCategory);247 extern void usageGuestControl(PRTSTREAM pStrm, const char *pcszSep1, const char *pcszSep2, uint64_t fSubcommandScope); 241 248 242 249 #ifndef VBOX_ONLY_DOCS -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp
r76553 r77595 261 261 else 262 262 fVmOptionRead = true; 263 u8Slot = (uint8_t)~0; /* clear slo r*/263 u8Slot = (uint8_t)~0; /* clear slot */ 264 264 pszVmName = RTStrDup(ValueUnion.psz); 265 265 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r76553 r77595 130 130 DECLR3CALLBACKMEMBER(RTEXITCODE, pfnHandler, (struct GCTLCMDCTX *pCtx, int argc, char **argv)); 131 131 132 /** The command usage flags. */133 uint 32_t fCmdUsage;132 /** The sub-command scope flags. */ 133 uint64_t fSubcommandScope; 134 134 /** Command context flags (GCTLCMDCTX_F_XXX). */ 135 135 uint32_t fCmdCtx; … … 227 227 228 228 229 void usageGuestControl(PRTSTREAM pStrm, const char *pcszSep1, const char *pcszSep2, uint 32_t uSubCmd)230 { 231 const uint 32_t fAnonSubCmds = USAGE_GSTCTRL_CLOSESESSION232 | USAGE_GSTCTRL_LIST233 | USAGE_GSTCTRL_CLOSEPROCESS234 | USAGE_GSTCTRL_CLOSESESSION235 | USAGE_GSTCTRL_UPDATEGA236 | USAGE_GSTCTRL_WATCH;229 void usageGuestControl(PRTSTREAM pStrm, const char *pcszSep1, const char *pcszSep2, uint64_t fSubcommandScope) 230 { 231 const uint64_t fAnonSubCmds = HELP_SCOPE_GSTCTRL_CLOSESESSION 232 | HELP_SCOPE_GSTCTRL_LIST 233 | HELP_SCOPE_GSTCTRL_CLOSEPROCESS 234 | HELP_SCOPE_GSTCTRL_CLOSESESSION 235 | HELP_SCOPE_GSTCTRL_UPDATEGA 236 | HELP_SCOPE_GSTCTRL_WATCH; 237 237 238 238 /* 0 1 2 3 4 5 6 7 8XXXXXXXXXX */ 239 239 /* 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 */ 240 if (~fAnonSubCmds & uSubCmd)240 if (~fAnonSubCmds & fSubcommandScope) 241 241 RTStrmPrintf(pStrm, 242 242 "%s guestcontrol %s <uuid|vmname> [--verbose|-v] [--quiet|-q]\n" 243 243 " [--username <name>] [--domain <domain>]\n" 244 244 " [--passwordfile <file> | --password <password>]\n%s", 245 pcszSep1, pcszSep2, uSubCmd == ~0U? "\n" : "");246 if ( uSubCmd & USAGE_GSTCTRL_RUN)245 pcszSep1, pcszSep2, (fSubcommandScope & RTMSGREFENTRYSTR_SCOPE_MASK) == RTMSGREFENTRYSTR_SCOPE_GLOBAL ? "\n" : ""); 246 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_RUN) 247 247 RTStrmPrintf(pStrm, 248 248 " run [common-options]\n" … … 255 255 " -- <program/arg0> [argument1] ... [argumentN]]\n" 256 256 "\n"); 257 if ( uSubCmd & USAGE_GSTCTRL_START)257 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_START) 258 258 RTStrmPrintf(pStrm, 259 259 " start [common-options]\n" … … 263 263 " -- <program/arg0> [argument1] ... [argumentN]]\n" 264 264 "\n"); 265 if ( uSubCmd & USAGE_GSTCTRL_COPYFROM)265 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_COPYFROM) 266 266 RTStrmPrintf(pStrm, 267 267 " copyfrom [common-options]\n" … … 274 274 " <guest-src0> [guest-src1 [...]]\n" 275 275 "\n"); 276 if ( uSubCmd & USAGE_GSTCTRL_COPYTO)276 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_COPYTO) 277 277 RTStrmPrintf(pStrm, 278 278 " copyto [common-options]\n" … … 285 285 " <host-src0> [host-src1 [...]]\n" 286 286 "\n"); 287 if ( uSubCmd & USAGE_GSTCTRL_MKDIR)287 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_MKDIR) 288 288 RTStrmPrintf(pStrm, 289 289 " mkdir|createdir[ectory] [common-options]\n" … … 291 291 " <guest directory> [...]\n" 292 292 "\n"); 293 if ( uSubCmd & USAGE_GSTCTRL_RMDIR)293 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_RMDIR) 294 294 RTStrmPrintf(pStrm, 295 295 " rmdir|removedir[ectory] [common-options]\n" … … 297 297 " <guest directory> [...]\n" 298 298 "\n"); 299 if ( uSubCmd & USAGE_GSTCTRL_RM)299 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_RM) 300 300 RTStrmPrintf(pStrm, 301 301 " removefile|rm [common-options] [-f|--force]\n" 302 302 " <guest file> [...]\n" 303 303 "\n"); 304 if ( uSubCmd & USAGE_GSTCTRL_MV)304 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_MV) 305 305 RTStrmPrintf(pStrm, 306 306 " mv|move|ren[ame] [common-options]\n" 307 307 " <source> [source1 [...]] <dest>\n" 308 308 "\n"); 309 if ( uSubCmd & USAGE_GSTCTRL_MKTEMP)309 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_MKTEMP) 310 310 RTStrmPrintf(pStrm, 311 311 " mktemp|createtemp[orary] [common-options]\n" … … 313 313 " <template>\n" 314 314 "\n"); 315 if ( uSubCmd & USAGE_GSTCTRL_STAT)315 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_STAT) 316 316 RTStrmPrintf(pStrm, 317 317 " stat [common-options]\n" … … 322 322 * Command not requiring authentication. 323 323 */ 324 if (fAnonSubCmds & uSubCmd)324 if (fAnonSubCmds & fSubcommandScope) 325 325 { 326 326 /* 0 1 2 3 4 5 6 7 8XXXXXXXXXX */ … … 328 328 RTStrmPrintf(pStrm, 329 329 "%s guestcontrol %s <uuid|vmname> [--verbose|-v] [--quiet|-q]\n%s", 330 pcszSep1, pcszSep2, uSubCmd == ~0U? "\n" : "");331 if ( uSubCmd & USAGE_GSTCTRL_LIST)330 pcszSep1, pcszSep2, (fSubcommandScope & RTMSGREFENTRYSTR_SCOPE_MASK) == RTMSGREFENTRYSTR_SCOPE_GLOBAL ? "\n" : ""); 331 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_LIST) 332 332 RTStrmPrintf(pStrm, 333 333 " list <all|sessions|processes|files> [common-opts]\n" 334 334 "\n"); 335 if ( uSubCmd & USAGE_GSTCTRL_CLOSEPROCESS)335 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_CLOSEPROCESS) 336 336 RTStrmPrintf(pStrm, 337 337 " closeprocess [common-options]\n" … … 340 340 " <PID1> [PID1 [...]]\n" 341 341 "\n"); 342 if ( uSubCmd & USAGE_GSTCTRL_CLOSESESSION)342 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_CLOSESESSION) 343 343 RTStrmPrintf(pStrm, 344 344 " closesession [common-options]\n" … … 346 346 " | --session-name <name or pattern> >\n" 347 347 "\n"); 348 if ( uSubCmd & USAGE_GSTCTRL_UPDATEGA)348 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_UPDATEGA) 349 349 RTStrmPrintf(pStrm, 350 350 " updatega|updateguestadditions|updateadditions\n" … … 353 353 " [-- [<argument1>] ... [<argumentN>]]\n" 354 354 "\n"); 355 if ( uSubCmd & USAGE_GSTCTRL_WATCH)355 if (fSubcommandScope & HELP_SCOPE_GSTCTRL_WATCH) 356 356 RTStrmPrintf(pStrm, 357 357 " watch [common-options]\n" … … 966 966 } 967 967 else 968 rcExit = errorSyntaxEx(USAGE_GUESTCONTROL, pCtx->pCmdDef->f CmdUsage, "No user name specified!");968 rcExit = errorSyntaxEx(USAGE_GUESTCONTROL, pCtx->pCmdDef->fSubcommandScope, "No user name specified!"); 969 969 970 970 pCtx->fPostOptionParsingInited = rcExit == RTEXITCODE_SUCCESS; … … 1320 1320 if ( ValueUnion.psz[0] == '\0' 1321 1321 || ValueUnion.psz[0] == '=') 1322 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_RUN,1322 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_RUN, 1323 1323 "Invalid argument variable[=value]: '%s'", ValueUnion.psz); 1324 1324 aEnv.push_back(Bstr(ValueUnion.psz).raw()); … … 1390 1390 1391 1391 default: 1392 return errorGetOptEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_RUN, ch, &ValueUnion);1392 return errorGetOptEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_RUN, ch, &ValueUnion); 1393 1393 1394 1394 } /* switch */ … … 1397 1397 /* Must have something to execute. */ 1398 1398 if (!pszImage || !*pszImage) 1399 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_RUN, "No executable specified!");1399 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_RUN, "No executable specified!"); 1400 1400 1401 1401 /* … … 1668 1668 static DECLCALLBACK(RTEXITCODE) gctlHandleRun(PGCTLCMDCTX pCtx, int argc, char **argv) 1669 1669 { 1670 return gctlHandleRunCommon(pCtx, argc, argv, true /*fRunCmd*/, USAGE_GSTCTRL_RUN);1670 return gctlHandleRunCommon(pCtx, argc, argv, true /*fRunCmd*/, HELP_SCOPE_GSTCTRL_RUN); 1671 1671 } 1672 1672 … … 1674 1674 static DECLCALLBACK(RTEXITCODE) gctlHandleStart(PGCTLCMDCTX pCtx, int argc, char **argv) 1675 1675 { 1676 return gctlHandleRunCommon(pCtx, argc, argv, false /*fRunCmd*/, USAGE_GSTCTRL_START);1676 return gctlHandleRunCommon(pCtx, argc, argv, false /*fRunCmd*/, HELP_SCOPE_GSTCTRL_START); 1677 1677 } 1678 1678 … … 1718 1718 bool fFollow = false; 1719 1719 bool fRecursive = false; 1720 uint 32_t uUsage = fHostToGuest ? USAGE_GSTCTRL_COPYTO : USAGE_GSTCTRL_COPYFROM;1720 uint64_t uUsage = fHostToGuest ? HELP_SCOPE_GSTCTRL_COPYTO : HELP_SCOPE_GSTCTRL_COPYFROM; 1721 1721 1722 1722 int vrc = VINF_SUCCESS; … … 2014 2014 2015 2015 default: 2016 return errorGetOptEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_MKDIR, ch, &ValueUnion);2016 return errorGetOptEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_MKDIR, ch, &ValueUnion); 2017 2017 } 2018 2018 } 2019 2019 2020 2020 if (!cDirsCreated) 2021 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_MKDIR, "No directory to create specified!");2021 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_MKDIR, "No directory to create specified!"); 2022 2022 return rcExit; 2023 2023 } … … 2135 2135 2136 2136 default: 2137 return errorGetOptEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_RMDIR, ch, &ValueUnion);2137 return errorGetOptEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_RMDIR, ch, &ValueUnion); 2138 2138 } 2139 2139 } 2140 2140 2141 2141 if (!cDirRemoved) 2142 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_RMDIR, "No directory to remove specified!");2142 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_RMDIR, "No directory to remove specified!"); 2143 2143 return rcExit; 2144 2144 } … … 2211 2211 2212 2212 default: 2213 return errorGetOptEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_RM, ch, &ValueUnion);2213 return errorGetOptEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_RM, ch, &ValueUnion); 2214 2214 } 2215 2215 } 2216 2216 2217 2217 if (!cFilesDeleted && !fForce) 2218 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_RM, "No file to remove specified!");2218 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_RM, "No file to remove specified!"); 2219 2219 return rcExit; 2220 2220 } … … 2264 2264 2265 2265 default: 2266 return errorGetOptEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_MV, ch, &ValueUnion);2266 return errorGetOptEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_MV, ch, &ValueUnion); 2267 2267 } 2268 2268 } … … 2278 2278 size_t cSources = vecSources.size(); 2279 2279 if (!cSources) 2280 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_MV,2280 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_MV, 2281 2281 "No source(s) to move specified!"); 2282 2282 if (cSources < 2) 2283 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_MV,2283 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_MV, 2284 2284 "No destination specified!"); 2285 2285 … … 2421 2421 strTemplate = ValueUnion.psz; 2422 2422 else 2423 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_MKTEMP,2423 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_MKTEMP, 2424 2424 "More than one template specified!\n"); 2425 2425 break; 2426 2426 2427 2427 default: 2428 return errorGetOptEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_MKTEMP, ch, &ValueUnion);2428 return errorGetOptEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_MKTEMP, ch, &ValueUnion); 2429 2429 } 2430 2430 } 2431 2431 2432 2432 if (strTemplate.isEmpty()) 2433 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_MKTEMP,2433 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_MKTEMP, 2434 2434 "No template specified!"); 2435 2435 2436 2436 if (!fDirectory) 2437 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_MKTEMP,2437 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_MKTEMP, 2438 2438 "Creating temporary files is currently not supported!"); 2439 2439 … … 2513 2513 case 'c': /* Format */ 2514 2514 case 't': /* Terse */ 2515 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_STAT,2515 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_STAT, 2516 2516 "Command \"%s\" not implemented yet!", ValueUnion.psz); 2517 2517 2518 2518 default: 2519 return errorGetOptEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_STAT, ch, &ValueUnion);2519 return errorGetOptEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_STAT, ch, &ValueUnion); 2520 2520 } 2521 2521 } 2522 2522 2523 2523 if (ch != VINF_GETOPT_NOT_OPTION) 2524 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_STAT, "Nothing to stat!");2524 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_STAT, "Nothing to stat!"); 2525 2525 2526 2526 RTEXITCODE rcExit = gctlCtxPostOptionParsingInit(pCtx); … … 2668 2668 2669 2669 default: 2670 return errorGetOptEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_UPDATEGA, ch, &ValueUnion);2670 return errorGetOptEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_UPDATEGA, ch, &ValueUnion); 2671 2671 } 2672 2672 } … … 2786 2786 fListAll = true; 2787 2787 else 2788 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_LIST,2788 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_LIST, 2789 2789 "Unknown list: '%s'", ValueUnion.psz); 2790 2790 fSeenListArg = true; … … 2792 2792 2793 2793 default: 2794 return errorGetOptEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_UPDATEGA, ch, &ValueUnion);2794 return errorGetOptEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_UPDATEGA, ch, &ValueUnion); 2795 2795 } 2796 2796 } 2797 2797 2798 2798 if (!fSeenListArg) 2799 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_LIST, "Missing list name");2799 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_LIST, "Missing list name"); 2800 2800 Assert(fListAll || fListSessions); 2801 2801 … … 2972 2972 } 2973 2973 else 2974 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_CLOSEPROCESS, "Invalid PID value: 0");2974 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_CLOSEPROCESS, "Invalid PID value: 0"); 2975 2975 } 2976 2976 else 2977 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_CLOSEPROCESS, "Error parsing PID value: %Rrc", rc);2977 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_CLOSEPROCESS, "Error parsing PID value: %Rrc", rc); 2978 2978 break; 2979 2979 } 2980 2980 2981 2981 default: 2982 return errorGetOptEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_CLOSEPROCESS, ch, &ValueUnion);2982 return errorGetOptEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_CLOSEPROCESS, ch, &ValueUnion); 2983 2983 } 2984 2984 } 2985 2985 2986 2986 if (vecPID.empty()) 2987 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_CLOSEPROCESS,2987 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_CLOSEPROCESS, 2988 2988 "At least one PID must be specified to kill!"); 2989 2989 2990 2990 if ( strSessionName.isEmpty() 2991 2991 && idSession == UINT32_MAX) 2992 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_CLOSEPROCESS, "No session ID specified!");2992 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_CLOSEPROCESS, "No session ID specified!"); 2993 2993 2994 2994 if ( strSessionName.isNotEmpty() 2995 2995 && idSession != UINT32_MAX) 2996 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_CLOSEPROCESS,2996 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_CLOSEPROCESS, 2997 2997 "Either session ID or name (pattern) must be specified"); 2998 2998 … … 3140 3140 * break; */ 3141 3141 default: 3142 return errorGetOptEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_CLOSESESSION, ch, &ValueUnion);3142 return errorGetOptEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_CLOSESESSION, ch, &ValueUnion); 3143 3143 } 3144 3144 } … … 3146 3146 if ( strSessionName.isEmpty() 3147 3147 && idSession == UINT32_MAX) 3148 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_CLOSESESSION,3148 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_CLOSESESSION, 3149 3149 "No session ID specified!"); 3150 3150 3151 3151 if ( !strSessionName.isEmpty() 3152 3152 && idSession != UINT32_MAX) 3153 return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_CLOSESESSION,3153 return errorSyntaxEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_CLOSESESSION, 3154 3154 "Either session ID or name (pattern) must be specified"); 3155 3155 … … 3238 3238 case VINF_GETOPT_NOT_OPTION: 3239 3239 default: 3240 return errorGetOptEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_WATCH, ch, &ValueUnion);3240 return errorGetOptEx(USAGE_GUESTCONTROL, HELP_SCOPE_GSTCTRL_WATCH, ch, &ValueUnion); 3241 3241 } 3242 3242 } … … 3326 3326 static const GCTLCMDDEF s_aCmdDefs[] = 3327 3327 { 3328 { "run", gctlHandleRun, USAGE_GSTCTRL_RUN, 0, },3329 { "start", gctlHandleStart, USAGE_GSTCTRL_START, 0, },3330 { "copyfrom", gctlHandleCopyFrom, USAGE_GSTCTRL_COPYFROM, 0, },3331 { "copyto", gctlHandleCopyTo, USAGE_GSTCTRL_COPYTO, 0, },3332 3333 { "mkdir", gctrlHandleMkDir, USAGE_GSTCTRL_MKDIR, 0, },3334 { "md", gctrlHandleMkDir, USAGE_GSTCTRL_MKDIR, 0, },3335 { "createdirectory", gctrlHandleMkDir, USAGE_GSTCTRL_MKDIR, 0, },3336 { "createdir", gctrlHandleMkDir, USAGE_GSTCTRL_MKDIR, 0, },3337 3338 { "rmdir", gctlHandleRmDir, USAGE_GSTCTRL_RMDIR, 0, },3339 { "removedir", gctlHandleRmDir, USAGE_GSTCTRL_RMDIR, 0, },3340 { "removedirectory", gctlHandleRmDir, USAGE_GSTCTRL_RMDIR, 0, },3341 3342 { "rm", gctlHandleRm, USAGE_GSTCTRL_RM, 0, },3343 { "removefile", gctlHandleRm, USAGE_GSTCTRL_RM, 0, },3344 { "erase", gctlHandleRm, USAGE_GSTCTRL_RM, 0, },3345 { "del", gctlHandleRm, USAGE_GSTCTRL_RM, 0, },3346 { "delete", gctlHandleRm, USAGE_GSTCTRL_RM, 0, },3347 3348 { "mv", gctlHandleMv, USAGE_GSTCTRL_MV, 0, },3349 { "move", gctlHandleMv, USAGE_GSTCTRL_MV, 0, },3350 { "ren", gctlHandleMv, USAGE_GSTCTRL_MV, 0, },3351 { "rename", gctlHandleMv, USAGE_GSTCTRL_MV, 0, },3352 3353 { "mktemp", gctlHandleMkTemp, USAGE_GSTCTRL_MKTEMP, 0, },3354 { "createtemp", gctlHandleMkTemp, USAGE_GSTCTRL_MKTEMP, 0, },3355 { "createtemporary", gctlHandleMkTemp, USAGE_GSTCTRL_MKTEMP, 0, },3356 3357 { "stat", gctlHandleStat, USAGE_GSTCTRL_STAT, 0, },3358 3359 { "closeprocess", gctlHandleCloseProcess, USAGE_GSTCTRL_CLOSEPROCESS, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, },3360 { "closesession", gctlHandleCloseSession, USAGE_GSTCTRL_CLOSESESSION, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, },3361 { "list", gctlHandleList, USAGE_GSTCTRL_LIST, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, },3362 { "watch", gctlHandleWatch, USAGE_GSTCTRL_WATCH, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, },3363 3364 {"updateguestadditions",gctlHandleUpdateAdditions, USAGE_GSTCTRL_UPDATEGA, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, },3365 { "updateadditions", gctlHandleUpdateAdditions, USAGE_GSTCTRL_UPDATEGA, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, },3366 { "updatega", gctlHandleUpdateAdditions, USAGE_GSTCTRL_UPDATEGA, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, },3328 { "run", gctlHandleRun, HELP_SCOPE_GSTCTRL_RUN, 0, }, 3329 { "start", gctlHandleStart, HELP_SCOPE_GSTCTRL_START, 0, }, 3330 { "copyfrom", gctlHandleCopyFrom, HELP_SCOPE_GSTCTRL_COPYFROM, 0, }, 3331 { "copyto", gctlHandleCopyTo, HELP_SCOPE_GSTCTRL_COPYTO, 0, }, 3332 3333 { "mkdir", gctrlHandleMkDir, HELP_SCOPE_GSTCTRL_MKDIR, 0, }, 3334 { "md", gctrlHandleMkDir, HELP_SCOPE_GSTCTRL_MKDIR, 0, }, 3335 { "createdirectory", gctrlHandleMkDir, HELP_SCOPE_GSTCTRL_MKDIR, 0, }, 3336 { "createdir", gctrlHandleMkDir, HELP_SCOPE_GSTCTRL_MKDIR, 0, }, 3337 3338 { "rmdir", gctlHandleRmDir, HELP_SCOPE_GSTCTRL_RMDIR, 0, }, 3339 { "removedir", gctlHandleRmDir, HELP_SCOPE_GSTCTRL_RMDIR, 0, }, 3340 { "removedirectory", gctlHandleRmDir, HELP_SCOPE_GSTCTRL_RMDIR, 0, }, 3341 3342 { "rm", gctlHandleRm, HELP_SCOPE_GSTCTRL_RM, 0, }, 3343 { "removefile", gctlHandleRm, HELP_SCOPE_GSTCTRL_RM, 0, }, 3344 { "erase", gctlHandleRm, HELP_SCOPE_GSTCTRL_RM, 0, }, 3345 { "del", gctlHandleRm, HELP_SCOPE_GSTCTRL_RM, 0, }, 3346 { "delete", gctlHandleRm, HELP_SCOPE_GSTCTRL_RM, 0, }, 3347 3348 { "mv", gctlHandleMv, HELP_SCOPE_GSTCTRL_MV, 0, }, 3349 { "move", gctlHandleMv, HELP_SCOPE_GSTCTRL_MV, 0, }, 3350 { "ren", gctlHandleMv, HELP_SCOPE_GSTCTRL_MV, 0, }, 3351 { "rename", gctlHandleMv, HELP_SCOPE_GSTCTRL_MV, 0, }, 3352 3353 { "mktemp", gctlHandleMkTemp, HELP_SCOPE_GSTCTRL_MKTEMP, 0, }, 3354 { "createtemp", gctlHandleMkTemp, HELP_SCOPE_GSTCTRL_MKTEMP, 0, }, 3355 { "createtemporary", gctlHandleMkTemp, HELP_SCOPE_GSTCTRL_MKTEMP, 0, }, 3356 3357 { "stat", gctlHandleStat, HELP_SCOPE_GSTCTRL_STAT, 0, }, 3358 3359 { "closeprocess", gctlHandleCloseProcess, HELP_SCOPE_GSTCTRL_CLOSEPROCESS, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, }, 3360 { "closesession", gctlHandleCloseSession, HELP_SCOPE_GSTCTRL_CLOSESESSION, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, }, 3361 { "list", gctlHandleList, HELP_SCOPE_GSTCTRL_LIST, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, }, 3362 { "watch", gctlHandleWatch, HELP_SCOPE_GSTCTRL_WATCH, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, }, 3363 3364 {"updateguestadditions",gctlHandleUpdateAdditions, HELP_SCOPE_GSTCTRL_UPDATEGA, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, }, 3365 { "updateadditions", gctlHandleUpdateAdditions, HELP_SCOPE_GSTCTRL_UPDATEGA, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, }, 3366 { "updatega", gctlHandleUpdateAdditions, HELP_SCOPE_GSTCTRL_UPDATEGA, GCTLCMDCTX_F_SESSION_ANONYMOUS | GCTLCMDCTX_F_NO_SIGNAL_HANDLER, }, 3367 3367 }; 3368 3368 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r76906 r77595 24 24 #include <iprt/buildconfig.h> 25 25 #include <iprt/ctype.h> 26 #include <iprt/assert.h> 26 27 #include <iprt/env.h> 27 28 #include <iprt/err.h> … … 45 46 *********************************************************************************************************************************/ 46 47 #ifndef VBOX_ONLY_DOCS 47 enum HELP_CMD_VBOXMANAGE g_enmCurCommand = HELP_CMD_VBOXMANAGE_INVALID;48 /** The scope mask tfor the current subcommand. */49 uint64_t g_fCurSubcommandScope = RTMSGREFENTRYSTR_SCOPE_GLOBAL;48 static enum HELP_CMD_VBOXMANAGE g_enmCurCommand = HELP_CMD_VBOXMANAGE_INVALID; 49 /** The scope mask for the current subcommand. */ 50 static uint64_t g_fCurSubcommandScope = RTMSGREFENTRYSTR_SCOPE_GLOBAL; 50 51 51 52 /** … … 366 367 367 368 368 void printUsage(USAGECATEGORY fCategory, uint32_t fSubCategory, PRTSTREAM pStrm)369 void printUsage(USAGECATEGORY enmCommand, uint64_t fSubcommandScope, PRTSTREAM pStrm) 369 370 { 370 371 bool fDumpOpts = false; … … 400 401 #endif 401 402 402 if (fCategory == USAGE_DUMPOPTS) 403 Assert(enmCommand != USAGE_INVALID); 404 Assert(enmCommand != USAGE_S_NEWCMD); 405 406 if (enmCommand == USAGE_S_DUMPOPTS) 403 407 { 404 408 fDumpOpts = true; … … 409 413 fDarwin = true; 410 414 fVBoxSDL = true; 411 fCategory = USAGE_ALL;415 enmCommand = USAGE_S_ALL; 412 416 } 413 417 … … 416 420 "\n"); 417 421 418 if ( fCategory == USAGE_ALL)422 if (enmCommand == USAGE_S_ALL) 419 423 RTStrmPrintf(pStrm, 420 424 " VBoxManage [<general option>] <command>\n" … … 431 435 const char *pcszSep1 = " "; 432 436 const char *pcszSep2 = " "; 433 if ( fCategory != USAGE_ALL)437 if (enmCommand != USAGE_S_ALL) 434 438 { 435 439 pcszSep1 = "VBoxManage"; … … 439 443 #define SEP pcszSep1, pcszSep2 440 444 441 if ( fCategory & USAGE_LIST)445 if (enmCommand == USAGE_LIST || enmCommand == USAGE_S_ALL) 442 446 RTStrmPrintf(pStrm, 443 447 "%s list [--long|-l] [--sorted|-s]%s vms|runningvms|ostypes|hostdvds|hostfloppies|\n" … … 453 457 "\n", SEP); 454 458 455 if ( fCategory & USAGE_SHOWVMINFO)459 if (enmCommand == USAGE_SHOWVMINFO || enmCommand == USAGE_S_ALL) 456 460 RTStrmPrintf(pStrm, 457 461 "%s showvminfo %s <uuid|vmname> [--details]\n" … … 460 464 "\n", SEP, SEP); 461 465 462 if ( fCategory & USAGE_REGISTERVM)466 if (enmCommand == USAGE_REGISTERVM || enmCommand == USAGE_S_ALL) 463 467 RTStrmPrintf(pStrm, 464 468 "%s registervm %s <filename>\n" 465 469 "\n", SEP); 466 470 467 if ( fCategory & USAGE_UNREGISTERVM)471 if (enmCommand == USAGE_UNREGISTERVM || enmCommand == USAGE_S_ALL) 468 472 RTStrmPrintf(pStrm, 469 473 "%s unregistervm %s <uuid|vmname> [--delete]\n" 470 474 "\n", SEP); 471 475 472 if ( fCategory & USAGE_CREATEVM)476 if (enmCommand == USAGE_CREATEVM || enmCommand == USAGE_S_ALL) 473 477 RTStrmPrintf(pStrm, 474 478 "%s createvm %s --name <name>\n" … … 481 485 "\n", SEP); 482 486 483 if ( fCategory & USAGE_MODIFYVM)487 if (enmCommand == USAGE_MODIFYVM || enmCommand == USAGE_S_ALL) 484 488 { 485 489 RTStrmPrintf(pStrm, … … 730 734 } 731 735 732 if ( fCategory & USAGE_CLONEVM)736 if (enmCommand == USAGE_CLONEVM || enmCommand == USAGE_S_ALL) 733 737 RTStrmPrintf(pStrm, 734 738 "%s clonevm %s <uuid|vmname>\n" … … 744 748 "\n", SEP); 745 749 746 if ( fCategory & USAGE_MOVEVM)750 if (enmCommand == USAGE_MOVEVM || enmCommand == USAGE_S_ALL) 747 751 RTStrmPrintf(pStrm, 748 752 "%s movevm %s <uuid|vmname>\n" … … 751 755 "\n", SEP); 752 756 753 if ( fCategory & USAGE_IMPORTAPPLIANCE)757 if (enmCommand == USAGE_IMPORTAPPLIANCE || enmCommand == USAGE_S_ALL) 754 758 RTStrmPrintf(pStrm, 755 759 "%s import %s <ovfname/ovaname>\n" … … 760 764 " for a particular OVF)\n\n", SEP); 761 765 762 if ( fCategory & USAGE_EXPORTAPPLIANCE)766 if (enmCommand == USAGE_EXPORTAPPLIANCE || enmCommand == USAGE_S_ALL) 763 767 RTStrmPrintf(pStrm, 764 768 "%s export %s <machines> --output|-o <name>.<ovf/ova/tar.gz>\n" … … 791 795 "\n", SEP); 792 796 793 if ( fCategory & USAGE_STARTVM)797 if (enmCommand == USAGE_STARTVM || enmCommand == USAGE_S_ALL) 794 798 { 795 799 RTStrmPrintf(pStrm, … … 804 808 } 805 809 806 if ( fCategory & USAGE_CONTROLVM)810 if (enmCommand == USAGE_CONTROLVM || enmCommand == USAGE_S_ALL) 807 811 { 808 812 RTStrmPrintf(pStrm, … … 884 888 } 885 889 886 if ( fCategory & USAGE_DISCARDSTATE)890 if (enmCommand == USAGE_DISCARDSTATE || enmCommand == USAGE_S_ALL) 887 891 RTStrmPrintf(pStrm, 888 892 "%s discardstate %s <uuid|vmname>\n" 889 893 "\n", SEP); 890 894 891 if ( fCategory & USAGE_ADOPTSTATE)895 if (enmCommand == USAGE_ADOPTSTATE || enmCommand == USAGE_S_ALL) 892 896 RTStrmPrintf(pStrm, 893 897 "%s adoptstate %s <uuid|vmname> <state_file>\n" 894 898 "\n", SEP); 895 899 896 if ( fCategory & USAGE_SNAPSHOT)900 if (enmCommand == USAGE_SNAPSHOT || enmCommand == USAGE_S_ALL) 897 901 RTStrmPrintf(pStrm, 898 902 "%s snapshot %s <uuid|vmname>\n" … … 909 913 "\n", SEP); 910 914 911 if ( fCategory & USAGE_CLOSEMEDIUM)915 if (enmCommand == USAGE_CLOSEMEDIUM || enmCommand == USAGE_S_ALL) 912 916 RTStrmPrintf(pStrm, 913 917 "%s closemedium %s [disk|dvd|floppy] <uuid|filename>\n" … … 915 919 "\n", SEP); 916 920 917 if ( fCategory & USAGE_STORAGEATTACH)921 if (enmCommand == USAGE_STORAGEATTACH || enmCommand == USAGE_S_ALL) 918 922 RTStrmPrintf(pStrm, 919 923 "%s storageattach %s <uuid|vmname>\n" … … 948 952 "\n", SEP); 949 953 950 if ( fCategory & USAGE_STORAGECONTROLLER)954 if (enmCommand == USAGE_STORAGECONTROLLER || enmCommand == USAGE_S_ALL) 951 955 RTStrmPrintf(pStrm, 952 956 "%s storagectl %s <uuid|vmname>\n" … … 963 967 "\n", SEP); 964 968 965 if ( fCategory & USAGE_BANDWIDTHCONTROL)969 if (enmCommand == USAGE_BANDWIDTHCONTROL || enmCommand == USAGE_S_ALL) 966 970 RTStrmPrintf(pStrm, 967 971 "%s bandwidthctl %s <uuid|vmname>\n" … … 976 980 "\n", SEP); 977 981 978 if ( fCategory & USAGE_SHOWMEDIUMINFO)982 if (enmCommand == USAGE_SHOWMEDIUMINFO || enmCommand == USAGE_S_ALL) 979 983 RTStrmPrintf(pStrm, 980 984 "%s showmediuminfo %s [disk|dvd|floppy] <uuid|filename>\n" 981 985 "\n", SEP); 982 986 983 if ( fCategory & USAGE_CREATEMEDIUM)987 if (enmCommand == USAGE_CREATEMEDIUM || enmCommand == USAGE_S_ALL) 984 988 RTStrmPrintf(pStrm, 985 989 "%s createmedium %s [disk|dvd|floppy] --filename <filename>\n" … … 991 995 "\n", SEP); 992 996 993 if ( fCategory & USAGE_MODIFYMEDIUM)997 if (enmCommand == USAGE_MODIFYMEDIUM || enmCommand == USAGE_S_ALL) 994 998 RTStrmPrintf(pStrm, 995 999 "%s modifymedium %s [disk|dvd|floppy] <uuid|filename>\n" … … 1005 1009 "\n", SEP); 1006 1010 1007 if ( fCategory & USAGE_CLONEMEDIUM)1011 if (enmCommand == USAGE_CLONEMEDIUM || enmCommand == USAGE_S_ALL) 1008 1012 RTStrmPrintf(pStrm, 1009 1013 "%s clonemedium %s [disk|dvd|floppy] <uuid|inputfile> <uuid|outputfile>\n" … … 1013 1017 "\n", SEP); 1014 1018 1015 if ( fCategory & USAGE_MEDIUMPROPERTY)1019 if (enmCommand == USAGE_MEDIUMPROPERTY || enmCommand == USAGE_S_ALL) 1016 1020 RTStrmPrintf(pStrm, 1017 1021 "%s mediumproperty %s [disk|dvd|floppy] set <uuid|filename>\n" … … 1025 1029 "\n", SEP); 1026 1030 1027 if ( fCategory & USAGE_ENCRYPTMEDIUM)1031 if (enmCommand == USAGE_ENCRYPTMEDIUM || enmCommand == USAGE_S_ALL) 1028 1032 RTStrmPrintf(pStrm, 1029 1033 "%s encryptmedium %s <uuid|filename>\n" … … 1034 1038 "\n", SEP); 1035 1039 1036 if ( fCategory & USAGE_MEDIUMENCCHKPWD)1040 if (enmCommand == USAGE_MEDIUMENCCHKPWD || enmCommand == USAGE_S_ALL) 1037 1041 RTStrmPrintf(pStrm, 1038 1042 "%s checkmediumpwd %s <uuid|filename>\n" … … 1040 1044 "\n", SEP); 1041 1045 1042 if ( fCategory & USAGE_CONVERTFROMRAW)1046 if (enmCommand == USAGE_CONVERTFROMRAW || enmCommand == USAGE_S_ALL) 1043 1047 RTStrmPrintf(pStrm, 1044 1048 "%s convertfromraw %s <filename> <outputfile>\n" … … 1052 1056 "\n", SEP, SEP); 1053 1057 1054 if ( fCategory & USAGE_GETEXTRADATA)1058 if (enmCommand == USAGE_GETEXTRADATA || enmCommand == USAGE_S_ALL) 1055 1059 RTStrmPrintf(pStrm, 1056 1060 "%s getextradata %s global|<uuid|vmname>\n" … … 1058 1062 "\n", SEP); 1059 1063 1060 if ( fCategory & USAGE_SETEXTRADATA)1064 if (enmCommand == USAGE_SETEXTRADATA || enmCommand == USAGE_S_ALL) 1061 1065 RTStrmPrintf(pStrm, 1062 1066 "%s setextradata %s global|<uuid|vmname>\n" … … 1065 1069 "\n", SEP); 1066 1070 1067 if ( fCategory & USAGE_SETPROPERTY)1071 if (enmCommand == USAGE_SETPROPERTY || enmCommand == USAGE_S_ALL) 1068 1072 RTStrmPrintf(pStrm, 1069 1073 "%s setproperty %s machinefolder default|<folder> |\n" … … 1080 1084 "\n", SEP); 1081 1085 1082 if (fCategory & USAGE_USBFILTER_ADD) 1083 RTStrmPrintf(pStrm, 1084 "%s usbfilter %s add <index,0-N>\n" 1085 " --target <uuid|vmname>|global\n" 1086 " --name <string>\n" 1087 " --action ignore|hold (global filters only)\n" 1088 " [--active yes|no] (yes)\n" 1089 " [--vendorid <XXXX>] (null)\n" 1090 " [--productid <XXXX>] (null)\n" 1091 " [--revision <IIFF>] (null)\n" 1092 " [--manufacturer <string>] (null)\n" 1093 " [--product <string>] (null)\n" 1094 " [--remote yes|no] (null, VM filters only)\n" 1095 " [--serialnumber <string>] (null)\n" 1096 " [--maskedinterfaces <XXXXXXXX>]\n" 1097 "\n", SEP); 1098 1099 if (fCategory & USAGE_USBFILTER_MODIFY) 1100 RTStrmPrintf(pStrm, 1101 "%s usbfilter %s modify <index,0-N>\n" 1102 " --target <uuid|vmname>|global\n" 1103 " [--name <string>]\n" 1104 " [--action ignore|hold] (global filters only)\n" 1105 " [--active yes|no]\n" 1106 " [--vendorid <XXXX>|\"\"]\n" 1107 " [--productid <XXXX>|\"\"]\n" 1108 " [--revision <IIFF>|\"\"]\n" 1109 " [--manufacturer <string>|\"\"]\n" 1110 " [--product <string>|\"\"]\n" 1111 " [--remote yes|no] (null, VM filters only)\n" 1112 " [--serialnumber <string>|\"\"]\n" 1113 " [--maskedinterfaces <XXXXXXXX>]\n" 1114 "\n", SEP); 1115 1116 if (fCategory & USAGE_USBFILTER_REMOVE) 1117 RTStrmPrintf(pStrm, 1118 "%s usbfilter %s remove <index,0-N>\n" 1119 " --target <uuid|vmname>|global\n" 1120 "\n", SEP); 1121 1122 if (fCategory & USAGE_SHAREDFOLDER_ADD) 1123 RTStrmPrintf(pStrm, 1124 "%s sharedfolder %s add <uuid|vmname>\n" 1125 " --name <name> --hostpath <hostpath>\n" 1126 " [--transient] [--readonly] [--automount]\n" 1127 "\n", SEP); 1128 1129 if (fCategory & USAGE_SHAREDFOLDER_REMOVE) 1130 RTStrmPrintf(pStrm, 1131 "%s sharedfolder %s remove <uuid|vmname>\n" 1132 " --name <name> [--transient]\n" 1133 "\n", SEP); 1086 if (enmCommand == USAGE_USBFILTER || enmCommand == USAGE_S_ALL) 1087 { 1088 if (fSubcommandScope & HELP_SCOPE_USBFILTER_ADD) 1089 RTStrmPrintf(pStrm, 1090 "%s usbfilter %s add <index,0-N>\n" 1091 " --target <uuid|vmname>|global\n" 1092 " --name <string>\n" 1093 " --action ignore|hold (global filters only)\n" 1094 " [--active yes|no] (yes)\n" 1095 " [--vendorid <XXXX>] (null)\n" 1096 " [--productid <XXXX>] (null)\n" 1097 " [--revision <IIFF>] (null)\n" 1098 " [--manufacturer <string>] (null)\n" 1099 " [--product <string>] (null)\n" 1100 " [--remote yes|no] (null, VM filters only)\n" 1101 " [--serialnumber <string>] (null)\n" 1102 " [--maskedinterfaces <XXXXXXXX>]\n" 1103 "\n", SEP); 1104 1105 if (fSubcommandScope & HELP_SCOPE_USBFILTER_MODIFY) 1106 RTStrmPrintf(pStrm, 1107 "%s usbfilter %s modify <index,0-N>\n" 1108 " --target <uuid|vmname>|global\n" 1109 " [--name <string>]\n" 1110 " [--action ignore|hold] (global filters only)\n" 1111 " [--active yes|no]\n" 1112 " [--vendorid <XXXX>|\"\"]\n" 1113 " [--productid <XXXX>|\"\"]\n" 1114 " [--revision <IIFF>|\"\"]\n" 1115 " [--manufacturer <string>|\"\"]\n" 1116 " [--product <string>|\"\"]\n" 1117 " [--remote yes|no] (null, VM filters only)\n" 1118 " [--serialnumber <string>|\"\"]\n" 1119 " [--maskedinterfaces <XXXXXXXX>]\n" 1120 "\n", SEP); 1121 1122 if (fSubcommandScope & HELP_SCOPE_USBFILTER_REMOVE) 1123 RTStrmPrintf(pStrm, 1124 "%s usbfilter %s remove <index,0-N>\n" 1125 " --target <uuid|vmname>|global\n" 1126 "\n", SEP); 1127 } 1128 1129 if (enmCommand == USAGE_SHAREDFOLDER || enmCommand == USAGE_S_ALL) 1130 { 1131 if (fSubcommandScope & HELP_SCOPE_SHAREDFOLDER_ADD) 1132 RTStrmPrintf(pStrm, 1133 "%s sharedfolder %s add <uuid|vmname>\n" 1134 " --name <name> --hostpath <hostpath>\n" 1135 " [--transient] [--readonly] [--automount]\n" 1136 "\n", SEP); 1137 1138 if (fSubcommandScope & HELP_SCOPE_SHAREDFOLDER_REMOVE) 1139 RTStrmPrintf(pStrm, 1140 "%s sharedfolder %s remove <uuid|vmname>\n" 1141 " --name <name> [--transient]\n" 1142 "\n", SEP); 1143 } 1134 1144 1135 1145 #ifdef VBOX_WITH_GUEST_PROPS 1136 if ( fCategory & USAGE_GUESTPROPERTY)1146 if (enmCommand == USAGE_GUESTPROPERTY || enmCommand == USAGE_S_ALL) 1137 1147 usageGuestProperty(pStrm, SEP); 1138 1148 #endif /* VBOX_WITH_GUEST_PROPS defined */ 1139 1149 1140 1150 #ifdef VBOX_WITH_GUEST_CONTROL 1141 if ( fCategory & USAGE_GUESTCONTROL)1142 usageGuestControl(pStrm, SEP, fSub Category);1151 if (enmCommand == USAGE_GUESTCONTROL || enmCommand == USAGE_S_ALL) 1152 usageGuestControl(pStrm, SEP, fSubcommandScope); 1143 1153 #endif /* VBOX_WITH_GUEST_CONTROL defined */ 1144 1154 1145 if ( fCategory & USAGE_METRICS)1155 if (enmCommand == USAGE_METRICS || enmCommand == USAGE_S_ALL) 1146 1156 RTStrmPrintf(pStrm, 1147 1157 "%s metrics %s list [*|host|<vmname> [<metric_list>]]\n" … … 1168 1178 1169 1179 #if defined(VBOX_WITH_NAT_SERVICE) 1170 if ( fCategory & USAGE_NATNETWORK)1180 if (enmCommand == USAGE_NATNETWORK || enmCommand == USAGE_S_ALL) 1171 1181 { 1172 1182 RTStrmPrintf(pStrm, … … 1200 1210 1201 1211 #if defined(VBOX_WITH_NETFLT) 1202 if ( fCategory & USAGE_HOSTONLYIFS)1212 if (enmCommand == USAGE_HOSTONLYIFS || enmCommand == USAGE_S_ALL) 1203 1213 { 1204 1214 RTStrmPrintf(pStrm, … … 1215 1225 #endif 1216 1226 1217 if ( fCategory & USAGE_DHCPSERVER)1227 if (enmCommand == USAGE_DHCPSERVER || enmCommand == USAGE_S_ALL) 1218 1228 { 1219 1229 RTStrmPrintf(pStrm, … … 1237 1247 } 1238 1248 1239 if ( fCategory & USAGE_USBDEVSOURCE)1249 if (enmCommand == USAGE_USBDEVSOURCE || enmCommand == USAGE_S_ALL) 1240 1250 { 1241 1251 RTStrmPrintf(pStrm, … … 1248 1258 1249 1259 #ifndef VBOX_ONLY_DOCS /* Converted to man page, not needed. */ 1250 if ( fCategory == USAGE_ALL)1260 if (enmCommand == USAGE_S_ALL) 1251 1261 { 1252 1262 uint32_t cPendingBlankLines = 0; … … 1270 1280 * @returns RTEXITCODE_SYNTAX. 1271 1281 */ 1272 RTEXITCODE errorSyntax(USAGECATEGORY fCategory, const char *pszFormat, ...)1282 RTEXITCODE errorSyntax(USAGECATEGORY enmCommand, const char *pszFormat, ...) 1273 1283 { 1274 1284 va_list args; … … 1276 1286 #ifndef VBOX_ONLY_DOCS 1277 1287 if (g_fInternalMode) 1278 printUsageInternal( fCategory, g_pStdErr);1288 printUsageInternal(enmCommand, g_pStdErr); 1279 1289 else 1280 printUsage( fCategory, ~0U, g_pStdErr);1290 printUsage(enmCommand, RTMSGREFENTRYSTR_SCOPE_GLOBAL, g_pStdErr); 1281 1291 #else 1282 RT_NOREF_PV( fCategory);1292 RT_NOREF_PV(enmCommand); 1283 1293 #endif 1284 1294 va_start(args, pszFormat); … … 1292 1302 * @returns RTEXITCODE_SYNTAX. 1293 1303 */ 1294 RTEXITCODE errorSyntaxEx(USAGECATEGORY fCategory, uint32_t fSubCategory, const char *pszFormat, ...)1304 RTEXITCODE errorSyntaxEx(USAGECATEGORY enmCommand, uint64_t fSubcommandScope, const char *pszFormat, ...) 1295 1305 { 1296 1306 va_list args; … … 1298 1308 #ifndef VBOX_ONLY_DOCS 1299 1309 if (g_fInternalMode) 1300 printUsageInternal( fCategory, g_pStdErr);1310 printUsageInternal(enmCommand, g_pStdErr); 1301 1311 else 1302 printUsage( fCategory, fSubCategory, g_pStdErr);1312 printUsage(enmCommand, fSubcommandScope, g_pStdErr); 1303 1313 #else 1304 RT_NOREF2( fCategory, fSubCategory);1314 RT_NOREF2(enmCommand, fSubcommandScope); 1305 1315 #endif 1306 1316 va_start(args, pszFormat); … … 1315 1325 * @returns RTEXITCODE_SYNTAX. 1316 1326 * 1317 * @param fCategory The usage category of the command. 1318 * @param fSubCategory The usage sub-category of the command. 1319 * @param rc The RTGetOpt return code. 1320 * @param pValueUnion The value union. 1321 */ 1322 RTEXITCODE errorGetOptEx(USAGECATEGORY fCategory, uint32_t fSubCategory, int rc, union RTGETOPTUNION const *pValueUnion) 1327 * @param enmCommand The command. 1328 * @param fSubcommandScope The subcommand scope, REFENTRYSTR_SCOPE_GLOBAL 1329 * for all. 1330 * @param rc The RTGetOpt return code. 1331 * @param pValueUnion The value union. 1332 */ 1333 RTEXITCODE errorGetOptEx(USAGECATEGORY enmCommand, uint64_t fSubcommandScope, int rc, union RTGETOPTUNION const *pValueUnion) 1323 1334 { 1324 1335 /* … … 1338 1349 #ifndef VBOX_ONLY_DOCS 1339 1350 if (g_fInternalMode) 1340 printUsageInternal( fCategory, g_pStdOut);1351 printUsageInternal(enmCommand, g_pStdOut); 1341 1352 else 1342 printUsage( fCategory, fSubCategory, g_pStdOut);1353 printUsage(enmCommand, fSubcommandScope, g_pStdOut); 1343 1354 #endif 1344 1355 return RTEXITCODE_SUCCESS; … … 1351 1362 #ifndef VBOX_ONLY_DOCS 1352 1363 if (g_fInternalMode) 1353 printUsageInternal( fCategory, g_pStdErr);1364 printUsageInternal(enmCommand, g_pStdErr); 1354 1365 else 1355 printUsage( fCategory, fSubCategory, g_pStdErr);1366 printUsage(enmCommand, fSubcommandScope, g_pStdErr); 1356 1367 #else 1357 RT_NOREF2( fCategory, fSubCategory);1368 RT_NOREF2(enmCommand, fSubcommandScope); 1358 1369 #endif 1359 1370 … … 1380 1391 * @returns RTEXITCODE_SYNTAX. 1381 1392 * 1382 * @param fUsageCategory The usage category of the command.1393 * @param enmCommand The command. 1383 1394 * @param rc The RTGetOpt return code. 1384 1395 * @param pValueUnion The value union. 1385 1396 */ 1386 RTEXITCODE errorGetOpt(USAGECATEGORY fCategory, int rc, union RTGETOPTUNION const *pValueUnion)1387 { 1388 return errorGetOptEx( fCategory, ~0U, rc, pValueUnion);1397 RTEXITCODE errorGetOpt(USAGECATEGORY enmCommand, int rc, union RTGETOPTUNION const *pValueUnion) 1398 { 1399 return errorGetOptEx(enmCommand, RTMSGREFENTRYSTR_SCOPE_GLOBAL, rc, pValueUnion); 1389 1400 } 1390 1401 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r76553 r77595 1086 1086 /* we need at least four more parameters */ 1087 1087 if (a->argc < 5) 1088 return errorSyntax (USAGE_SHAREDFOLDER_ADD, "Not enough parameters");1088 return errorSyntaxEx(USAGE_SHAREDFOLDER, HELP_SCOPE_SHAREDFOLDER_ADD, "Not enough parameters"); 1089 1089 1090 1090 char *name = NULL; … … 1136 1136 } 1137 1137 else 1138 return errorSyntax (USAGE_SHAREDFOLDER_ADD, "Invalid parameter '%s'", Utf8Str(a->argv[i]).c_str());1138 return errorSyntaxEx(USAGE_SHAREDFOLDER, HELP_SCOPE_SHAREDFOLDER_ADD, "Invalid parameter '%s'", Utf8Str(a->argv[i]).c_str()); 1139 1139 } 1140 1140 1141 1141 if (NULL != strstr(name, " ")) 1142 return errorSyntax (USAGE_SHAREDFOLDER_ADD, "No spaces allowed in parameter '-name'!");1142 return errorSyntaxEx(USAGE_SHAREDFOLDER, HELP_SCOPE_SHAREDFOLDER_ADD, "No spaces allowed in parameter '-name'!"); 1143 1143 1144 1144 /* required arguments */ 1145 1145 if (!name || !hostpath) 1146 1146 { 1147 return errorSyntax (USAGE_SHAREDFOLDER_ADD, "Parameters --name and --hostpath are required");1147 return errorSyntaxEx(USAGE_SHAREDFOLDER, HELP_SCOPE_SHAREDFOLDER_ADD, "Parameters --name and --hostpath are required"); 1148 1148 } 1149 1149 … … 1190 1190 /* we need at least two more parameters */ 1191 1191 if (a->argc < 3) 1192 return errorSyntax (USAGE_SHAREDFOLDER_REMOVE, "Not enough parameters");1192 return errorSyntaxEx(USAGE_SHAREDFOLDER, HELP_SCOPE_SHAREDFOLDER_REMOVE, "Not enough parameters"); 1193 1193 1194 1194 char *name = NULL; … … 1211 1211 } 1212 1212 else 1213 return errorSyntax (USAGE_SHAREDFOLDER_REMOVE, "Invalid parameter '%s'", Utf8Str(a->argv[i]).c_str());1213 return errorSyntaxEx(USAGE_SHAREDFOLDER, HELP_SCOPE_SHAREDFOLDER_REMOVE, "Invalid parameter '%s'", Utf8Str(a->argv[i]).c_str()); 1214 1214 } 1215 1215 1216 1216 /* required arguments */ 1217 1217 if (!name) 1218 return errorSyntax (USAGE_SHAREDFOLDER_REMOVE, "Parameter --name is required");1218 return errorSyntaxEx(USAGE_SHAREDFOLDER, HELP_SCOPE_SHAREDFOLDER_REMOVE, "Parameter --name is required"); 1219 1219 1220 1220 if (fTransient) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageUSB.cpp
r76553 r77595 198 198 { 199 199 if (cmd.mAction == USBFilterCmd::Add) 200 return errorSyntax (USAGE_USBFILTER_ADD, "Not enough parameters");201 202 return errorSyntax (USAGE_USBFILTER_MODIFY, "Not enough parameters");200 return errorSyntaxEx(USAGE_USBFILTER, HELP_SCOPE_USBFILTER_ADD, "Not enough parameters"); 201 202 return errorSyntaxEx(USAGE_USBFILTER, HELP_SCOPE_USBFILTER_MODIFY, "Not enough parameters"); 203 203 } 204 204 … … 329 329 } 330 330 else 331 return errorSyntax (cmd.mAction == USBFilterCmd::Add ? USAGE_USBFILTER_ADD : USAGE_USBFILTER_MODIFY,331 return errorSyntaxEx(USAGE_USBFILTER, cmd.mAction == USBFilterCmd::Add ? HELP_SCOPE_USBFILTER_ADD : HELP_SCOPE_USBFILTER_MODIFY, 332 332 "Unknown option '%s'", a->argv[i]); 333 333 } … … 347 347 ) 348 348 { 349 return errorSyntax (USAGE_USBFILTER_ADD, "Mandatory options not supplied");349 return errorSyntaxEx(USAGE_USBFILTER, HELP_SCOPE_USBFILTER_ADD, "Mandatory options not supplied"); 350 350 } 351 351 } … … 357 357 /* at least: 0: command, 1: index, 2: --target, 3: <target value> */ 358 358 if (a->argc < 4) 359 return errorSyntax (USAGE_USBFILTER_REMOVE, "Not enough parameters");359 return errorSyntaxEx(USAGE_USBFILTER, HELP_SCOPE_USBFILTER_REMOVE, "Not enough parameters"); 360 360 361 361 for (int i = 2; i < a->argc; i++) … … 379 379 // mandatory options 380 380 if (!cmd.mGlobal && !cmd.mMachine) 381 return errorSyntax (USAGE_USBFILTER_REMOVE, "Mandatory options not supplied");381 return errorSyntaxEx(USAGE_USBFILTER, HELP_SCOPE_USBFILTER_REMOVE, "Mandatory options not supplied"); 382 382 383 383 break;
Note:
See TracChangeset
for help on using the changeset viewer.