Changeset 33766 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Nov 4, 2010 2:05:28 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r33764 r33766 401 401 { "dhcpserver", USAGE_DHCPSERVER, handleDHCPServer}, 402 402 { "vrde", USAGE_VRDE, handleVRDE}, 403 { "extpack", USAGE_EXTPACK, handleExtPack}, 403 404 { NULL, 0, NULL } 404 405 }; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r33764 r33766 98 98 #define USAGE_PASSWORDHASH RT_BIT_64(54) 99 99 #define USAGE_VRDE RT_BIT_64(55) 100 #define USAGE_EXTPACK RT_BIT_64(56) 100 101 #define USAGE_ALL (~(uint64_t)0) 101 102 /** @} */ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r33764 r33766 115 115 " hostcpuids|hddbackends|hdds|dvds|floppies|\n" 116 116 " usbhost|usbfilters|systemproperties|\n" 117 " vrdelibraries \n"117 " vrdelibraries|extpacks\n" 118 118 "\n"); 119 119 } … … 727 727 "\n"); 728 728 } 729 if (u64Cmd & USAGE_EXTPACK) 730 { 731 RTStrmPrintf(pStrm, 732 "VBoxManage extpack install <tarball>\n" 733 "VBoxManage extpack uninstall [--force] <name>\n" 734 "\n"); 735 } 729 736 } 730 737 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r33759 r33766 185 185 } 186 186 } 187 188 189 /** 190 * List extension packs. 191 * 192 * @returns See produceList. 193 * @param rptrVirtualBox Reference to the IVirtualBox smart pointer. 194 */ 195 static HRESULT listExtensionPacks(const ComPtr<IVirtualBox> &rptrVirtualBox) 196 { 197 ComObjPtr<IExtPackManager> ptrExtPackMgr; 198 CHECK_ERROR2_RET(rptrVirtualBox, COMGETTER(ExtensionPackManager)(ptrExtPackMgr.asOutParam()), hrcCheck); 199 200 SafeIfaceArray<IExtPack> extPacks; 201 CHECK_ERROR2_RET(ptrExtPackMgr, COMGETTER(InstalledExtPacks)(ComSafeArrayAsOutParam(extPacks)), hrcCheck); 202 RTPrintf("Extension Packs: %u\n", extPacks.size()); 203 204 HRESULT hrc = S_OK; 205 for (size_t i = 0; i < extPacks.size(); i++) 206 { 207 /* Read all the properties. */ 208 Bstr bstrName; 209 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(Name)(bstrName.asOutParam()), hrc = hrcCheck; bstrName.setNull()); 210 Bstr bstrDesc; 211 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(Description)(bstrDesc.asOutParam()), hrc = hrcCheck; bstrDesc.setNull()); 212 Bstr bstrVersion; 213 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(Version)(bstrVersion.asOutParam()), hrc = hrcCheck; bstrVersion.setNull()); 214 ULONG uRevision; 215 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(Revision)(&uRevision), hrc = hrcCheck; uRevision = 0); 216 BOOL fUsable; 217 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(Usable)(&fUsable), hrc = hrcCheck; fUsable = FALSE); 218 Bstr bstrWhy; 219 CHECK_ERROR2_STMT(extPacks[i], COMGETTER(WhyUnusable)(bstrWhy.asOutParam()), hrc = hrcCheck; bstrWhy.setNull()); 220 221 /* Display them. */ 222 if (i) 223 RTPrintf("\n"); 224 RTPrintf("Pack no.%2zu: %lS\n" 225 "Version: %lS\n" 226 "Revision: %u\n" 227 "Description: %lS\n" 228 "Usable: %RTbool\n" 229 "Why unusable: %lS\n", 230 i, bstrName.raw(), 231 bstrVersion.raw(), 232 uRevision, 233 bstrDesc.raw(), 234 fUsable != FALSE, 235 bstrWhy.raw()); 236 } 237 return hrc; 238 } 239 187 240 188 241 /** … … 211 264 kListSystemProperties, 212 265 kListDhcpServers, 213 kListVrdeLibraries 266 kListVrdeLibraries, 267 kListExtPacks 214 268 }; 215 269 … … 613 667 CHECK_ERROR_RET(rptrVirtualBox, COMGETTER(Host)(Host.asOutParam()), 1); 614 668 615 SafeIfaceArray 669 SafeIfaceArray<IHostUSBDevice> CollPtr; 616 670 CHECK_ERROR_RET(Host, COMGETTER(USBDevices)(ComSafeArrayAsOutParam(CollPtr)), 1); 617 671 … … 870 924 SafeArray<BSTR> libs; 871 925 CHECK_ERROR(rptrVirtualBox, VRDEListLibraries(ComSafeArrayAsOutParam(libs))); 872 for (size_t i = 0; i < libs.size(); ++i) 873 { 874 Bstr bstrName(libs[i]); 875 RTPrintf("%lS\n", bstrName.raw()); 876 } 877 break; 878 } 926 if (SUCCEEDED(rc)) 927 { 928 for (size_t i = 0; i < libs.size(); ++i) 929 { 930 Bstr bstrName(libs[i]); 931 RTPrintf("%lS\n", bstrName.raw()); 932 } 933 } 934 break; 935 } 936 937 case kListExtPacks: 938 rc = listExtensionPacks(rptrVirtualBox); 939 break; 879 940 880 941 /* No default here, want gcc warnings. */ … … 922 983 { "dhcpservers", kListDhcpServers, RTGETOPT_REQ_NOTHING }, 923 984 { "vrdelibraries", kListVrdeLibraries, RTGETOPT_REQ_NOTHING }, 985 { "extpacks", kListExtPacks, RTGETOPT_REQ_NOTHING }, 924 986 }; 925 987 … … 964 1026 case kListDhcpServers: 965 1027 case kListVrdeLibraries: 1028 case kListExtPacks: 966 1029 enmOptCommand = (enum enmListType)ch; 967 1030 if (fOptMultiple) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r33556 r33766 911 911 } 912 912 913 int handleExtPack(HandlerArg *a) 914 { 915 if (a->argc < 2) 916 return errorSyntax(USAGE_EXTPACK, "Incorrect number of parameters"); 917 918 ComObjPtr<IExtPackManager> ptrExtPackMgr; 919 CHECK_ERROR2_RET(a->virtualBox, COMGETTER(ExtensionPackManager)(ptrExtPackMgr.asOutParam()), RTEXITCODE_FAILURE); 920 921 RTGETOPTSTATE GetState; 922 RTGETOPTUNION ValueUnion; 923 int ch; 924 HRESULT hrc = S_OK; 925 926 if (!strcmp(a->argv[0], "install")) 927 { 928 if (a->argc > 2) 929 return errorSyntax(USAGE_EXTPACK, "Too many parameters given to \"extpack install\""); 930 931 Bstr bstrTarball(a->argv[1]); 932 Bstr bstrName; 933 CHECK_ERROR2_RET(ptrExtPackMgr, Install(bstrTarball.raw(), bstrName.asOutParam()), RTEXITCODE_FAILURE); 934 RTPrintf("Successfully installed \"%lS\".\n", bstrName.raw()); 935 } 936 else if (!strcmp(a->argv[0], "uninstall")) 937 { 938 const char *pszName = NULL; 939 bool fForced = false; 940 941 static const RTGETOPTDEF s_aUninstallOptions[] = 942 { 943 { "--forced", 'f', RTGETOPT_REQ_NOTHING }, 944 }; 945 946 RTGetOptInit(&GetState, a->argc, a->argv, s_aUninstallOptions, RT_ELEMENTS(s_aUninstallOptions), 947 1, RTGETOPTINIT_FLAGS_NO_STD_OPTS); 948 while ((ch = RTGetOpt(&GetState, &ValueUnion))) 949 { 950 switch (ch) 951 { 952 case 'f': 953 fForced = true; 954 break; 955 956 case VINF_GETOPT_NOT_OPTION: 957 if (pszName) 958 return errorSyntax(USAGE_EXTPACK, "Too many extension pack names given to \"extpack uninstall\""); 959 pszName = ValueUnion.psz; 960 break; 961 962 default: 963 return errorGetOpt(USAGE_EXTPACK, ch, &ValueUnion); 964 } 965 } 966 if (!pszName) 967 return errorSyntax(USAGE_EXTPACK, "Not extension pack name was given to \"extpack uninstall\""); 968 969 Bstr bstrName(pszName); 970 CHECK_ERROR2_RET(ptrExtPackMgr, Uninstall(bstrName.raw(), fForced), RTEXITCODE_FAILURE); 971 RTPrintf("Successfully uninstalled \"%s\".\n", pszName); 972 } 973 else 974 return errorSyntax(USAGE_EXTPACK, "Unknown command \"%s\"", a->argv[0]); 975 976 return RTEXITCODE_SUCCESS; 977 } 978 979
Note:
See TracChangeset
for help on using the changeset viewer.