Changeset 18777 in vbox for trunk/src/VBox
- Timestamp:
- Apr 6, 2009 3:33:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageSnapshot.cpp
r17104 r18777 68 68 69 69 /* switch based on the command */ 70 if ( strcmp(a->argv[1], "take") == 0)70 if (!strcmp(a->argv[1], "take")) 71 71 { 72 72 /* there must be a name */ … … 78 78 } 79 79 Bstr name(a->argv[2]); 80 if ((a->argc > 3) && ((a->argc != 5) || (strcmp(a->argv[3], "-desc") != 0))) 80 if ((a->argc > 3) && ( (a->argc != 5) 81 || ( strcmp(a->argv[3], "--description") 82 && strcmp(a->argv[3], "-description") 83 && strcmp(a->argv[3], "-desc")))) 81 84 { 82 85 errorSyntax(USAGE_SNAPSHOT, "Incorrect description format"); … … 101 104 } 102 105 } 103 else if ( strcmp(a->argv[1], "discard") == 0)106 else if (!strcmp(a->argv[1], "discard")) 104 107 { 105 108 /* exactly one parameter: snapshot name */ … … 141 144 } 142 145 } 143 else if ( strcmp(a->argv[1], "discardcurrent") == 0)146 else if (!strcmp(a->argv[1], "discardcurrent")) 144 147 { 145 148 if ( (a->argc != 3) 146 || ( (strcmp(a->argv[2], "-state") != 0) 147 && (strcmp(a->argv[2], "-all") != 0))) 149 || ( strcmp(a->argv[2], "--state") 150 && strcmp(a->argv[2], "-state") 151 && strcmp(a->argv[2], "--all") 152 && strcmp(a->argv[2], "-all"))) 148 153 { 149 154 errorSyntax(USAGE_SNAPSHOT, "Invalid parameter '%s'", Utf8Str(a->argv[2]).raw()); … … 152 157 } 153 158 bool fAll = false; 154 if (strcmp(a->argv[2], "-all") == 0) 159 if ( !strcmp(a->argv[2], "--all") 160 || !strcmp(a->argv[2], "-all")) 155 161 fAll = true; 156 162 … … 178 184 179 185 } 180 else if ( strcmp(a->argv[1], "edit") == 0)186 else if (!strcmp(a->argv[1], "edit")) 181 187 { 182 188 if (a->argc < 3) … … 189 195 ComPtr<ISnapshot> snapshot; 190 196 191 if (strcmp(a->argv[2], "-current") == 0) 197 if ( !strcmp(a->argv[2], "--current") 198 || !strcmp(a->argv[2], "-current")) 192 199 { 193 200 CHECK_ERROR_BREAK(machine, COMGETTER(CurrentSnapshot)(snapshot.asOutParam())); … … 211 218 for (int i = 3; i < a->argc; i++) 212 219 { 213 if (strcmp(a->argv[i], "-newname") == 0) 220 if ( !strcmp(a->argv[i], "--name") 221 || !strcmp(a->argv[i], "-name") 222 || !strcmp(a->argv[i], "-newname")) 214 223 { 215 224 if (a->argc <= i + 1) … … 222 231 snapshot->COMSETTER(Name)(Bstr(a->argv[i])); 223 232 } 224 else if (strcmp(a->argv[i], "-newdesc") == 0) 233 else if ( !strcmp(a->argv[i], "--description") 234 || !strcmp(a->argv[i], "-description") 235 || !strcmp(a->argv[i], "-newdesc")) 225 236 { 226 237 if (a->argc <= i + 1) … … 242 253 243 254 } 244 else if ( strcmp(a->argv[1], "showvminfo") == 0)255 else if (!strcmp(a->argv[1], "showvminfo")) 245 256 { 246 257 /* exactly one parameter: snapshot name */
Note:
See TracChangeset
for help on using the changeset viewer.