Changeset 80739 in vbox
- Timestamp:
- Sep 11, 2019 11:05:01 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageCloud.cpp
r79980 r80739 957 957 static const RTGETOPTDEF s_aOptions[] = 958 958 { 959 { "--id", 'i', RTGETOPT_REQ_STRING }, 959 960 { "--bucket-name", 'b', RTGETOPT_REQ_STRING }, 960 961 { "--object-name", 'o', RTGETOPT_REQ_STRING }, 961 { "--id", 'i', RTGETOPT_REQ_STRING } 962 { "--display-name", 'd', RTGETOPT_REQ_STRING }, 963 { "--launch-mode", 'm', RTGETOPT_REQ_STRING }, 962 964 }; 963 965 RTGETOPTSTATE GetState; … … 966 968 AssertRCReturn(vrc, RTEXITCODE_FAILURE); 967 969 970 Utf8Str strImageId; /* XXX: this is vbox "image", i.e. medium */ 968 971 Utf8Str strBucketName; 969 972 Utf8Str strObjectName; 970 Utf8Str strImageId; 973 Utf8Str strDisplayName; 974 Utf8Str strLaunchMode; 971 975 com::SafeArray<BSTR> parameters; 972 976 … … 976 980 switch (c) 977 981 { 978 case 'b': 982 case 'b': /* --bucket-name */ 979 983 { 980 984 if (strBucketName.isNotEmpty()) … … 988 992 } 989 993 990 case 'o': 994 case 'o': /* --object-name */ 991 995 { 992 996 if (strObjectName.isNotEmpty()) … … 1000 1004 } 1001 1005 1002 case 'i': 1006 case 'i': /* --id */ 1003 1007 { 1004 1008 if (strImageId.isNotEmpty()) … … 1012 1016 } 1013 1017 1018 case 'd': /* --display-name */ 1019 { 1020 if (strDisplayName.isNotEmpty()) 1021 return errorArgument("Duplicate parameter: --display-name"); 1022 1023 strDisplayName = ValueUnion.psz; 1024 if (strDisplayName.isEmpty()) 1025 return errorArgument("Empty parameter: --display-name"); 1026 1027 break; 1028 } 1029 1030 case 'm': /* --launch-mode */ 1031 { 1032 if (strLaunchMode.isNotEmpty()) 1033 return errorArgument("Duplicate parameter: --launch-mode"); 1034 1035 strLaunchMode = ValueUnion.psz; 1036 if (strLaunchMode.isEmpty()) 1037 return errorArgument("Empty parameter: --launch-mode"); 1038 1039 break; 1040 } 1041 1014 1042 case VINF_GETOPT_NOT_OPTION: 1015 1043 return errorUnknownSubcommand(ValueUnion.psz); … … 1019 1047 } 1020 1048 } 1049 1050 if (strImageId.isNotEmpty()) 1051 BstrFmt("image-id=%s", strImageId.c_str()).detachTo(parameters.appendedRaw()); 1052 else 1053 return errorArgument("Missing parameter: --id"); 1021 1054 1022 1055 if (strBucketName.isNotEmpty()) … … 1025 1058 return errorArgument("Missing parameter: --bucket-name"); 1026 1059 1027 /* API will use display name as object name if not specified */1028 1060 if (strObjectName.isNotEmpty()) 1029 1061 BstrFmt("object-name=%s", strObjectName.c_str()).detachTo(parameters.appendedRaw()); 1030 1062 1031 if (strImageId.isNotEmpty()) 1032 BstrFmt("image-id=%s", strImageId.c_str()).detachTo(parameters.appendedRaw()); 1033 else 1034 return errorArgument("Missing parameter: --id"); 1063 if (strDisplayName.isNotEmpty()) 1064 BstrFmt("display-name=%s", strDisplayName.c_str()).detachTo(parameters.appendedRaw()); 1065 1066 if (strLaunchMode.isNotEmpty()) 1067 BstrFmt("launch-mode=%s", strLaunchMode.c_str()).detachTo(parameters.appendedRaw()); 1035 1068 1036 1069
Note:
See TracChangeset
for help on using the changeset viewer.