Changeset 77801 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Mar 19, 2019 5:44:40 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129468
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r77777 r77801 125 125 { "discardstate", USAGE_DISCARDSTATE, VBMG_CMD_TODO, handleDiscardState, 0 }, 126 126 { "adoptstate", USAGE_ADOPTSTATE, VBMG_CMD_TODO, handleAdoptState, 0 }, 127 { "snapshot", USAGE_S NAPSHOT, VBMG_CMD_TODO, handleSnapshot, 0 },127 { "snapshot", USAGE_S_NEWCMD, HELP_CMD_SNAPSHOT, handleSnapshot, 0 }, 128 128 { "closemedium", USAGE_CLOSEMEDIUM, VBMG_CMD_TODO, handleCloseMedium, 0 }, 129 129 { "storageattach", USAGE_STORAGEATTACH, VBMG_CMD_TODO, handleStorageAttach, 0 }, -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r77777 r77801 61 61 USAGE_CONTROLVM, 62 62 USAGE_DISCARDSTATE, 63 USAGE_SNAPSHOT,64 63 USAGE_CLOSEMEDIUM, 65 64 USAGE_SHOWMEDIUMINFO, -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r77606 r77801 898 898 "\n", SEP); 899 899 900 if (enmCommand == USAGE_SNAPSHOT || enmCommand == USAGE_S_ALL)901 RTStrmPrintf(pStrm,902 "%s snapshot %s <uuid|vmname>\n"903 " take <name> [--description <desc>] [--live]\n"904 " [--uniquename Number,Timestamp,Space,Force] |\n"905 " delete <uuid|snapname> |\n"906 " restore <uuid|snapname> |\n"907 " restorecurrent |\n"908 " edit <uuid|snapname>|--current\n"909 " [--name <name>]\n"910 " [--description <desc>] |\n"911 " list [--details|--machinereadable] |\n"912 " showvminfo <uuid|snapname>\n"913 "\n", SEP);914 915 900 if (enmCommand == USAGE_CLOSEMEDIUM || enmCommand == USAGE_S_ALL) 916 901 RTStrmPrintf(pStrm, -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageSnapshot.cpp
r76553 r77801 186 186 case 'D': enmDetails = VMINFO_FULL; break; 187 187 case 'M': enmDetails = VMINFO_MACHINEREADABLE; break; 188 default: return errorGetOpt( USAGE_SNAPSHOT,c, &ValueUnion);188 default: return errorGetOpt(c, &ValueUnion); 189 189 } 190 190 } … … 316 316 HRESULT rc; 317 317 318 /** @todo r=bird: sub-standard command line parsing here! 319 * 320 * 'VBoxManage snapshot empty take --help' takes a snapshot rather than display 321 * help as you would expect. 322 * 323 */ 324 318 325 /* we need at least a VM and a command */ 319 326 if (a->argc < 2) 320 return errorSyntax( USAGE_SNAPSHOT,"Not enough parameters");327 return errorSyntax("Not enough parameters"); 321 328 322 329 /* the first argument must be the VM */ … … 343 350 if (!strcmp(a->argv[1], "take")) 344 351 { 352 setCurrentSubcommand(HELP_SCOPE_SNAPSHOT_TAKE); 353 345 354 /* there must be a name */ 346 355 if (a->argc < 3) 347 356 { 348 errorSyntax( USAGE_SNAPSHOT,"Missing snapshot name");357 errorSyntax("Missing snapshot name"); 349 358 rc = E_FAIL; 350 359 break; … … 395 404 396 405 default: 397 errorGetOpt( USAGE_SNAPSHOT,ch, &Value);406 errorGetOpt(ch, &Value); 398 407 rc = E_FAIL; 399 408 break; … … 479 488 ) 480 489 { 490 setCurrentSubcommand(fDelete ? HELP_SCOPE_SNAPSHOT_DELETE 491 : fRestore ? HELP_SCOPE_SNAPSHOT_RESTORE 492 : HELP_SCOPE_SNAPSHOT_RESTORECURRENT); 493 481 494 if (fRestoreCurrent) 482 495 { 483 496 if (a->argc > 2) 484 497 { 485 errorSyntax( USAGE_SNAPSHOT,"Too many arguments");498 errorSyntax("Too many arguments"); 486 499 rc = E_FAIL; 487 500 break; … … 491 504 else if (a->argc != 3) 492 505 { 493 errorSyntax( USAGE_SNAPSHOT,"Expecting snapshot name only");506 errorSyntax("Expecting snapshot name only"); 494 507 rc = E_FAIL; 495 508 break; … … 541 554 else if (!strcmp(a->argv[1], "edit")) 542 555 { 556 setCurrentSubcommand(HELP_SCOPE_SNAPSHOT_EDIT); 543 557 if (a->argc < 3) 544 558 { 545 errorSyntax( USAGE_SNAPSHOT,"Missing snapshot name");559 errorSyntax("Missing snapshot name"); 546 560 rc = E_FAIL; 547 561 break; … … 597 611 else 598 612 { 599 errorSyntax( USAGE_SNAPSHOT,"Invalid parameter '%s'", Utf8Str(a->argv[i]).c_str());613 errorSyntax("Invalid parameter '%s'", Utf8Str(a->argv[i]).c_str()); 600 614 rc = E_FAIL; 601 615 break; … … 606 620 else if (!strcmp(a->argv[1], "showvminfo")) 607 621 { 622 setCurrentSubcommand(HELP_SCOPE_SNAPSHOT_SHOWVMINFO); 623 608 624 /* exactly one parameter: snapshot name */ 609 625 if (a->argc != 3) 610 626 { 611 errorSyntax( USAGE_SNAPSHOT,"Expecting snapshot name only");627 errorSyntax("Expecting snapshot name only"); 612 628 rc = E_FAIL; 613 629 break; … … 625 641 } 626 642 else if (!strcmp(a->argv[1], "list")) 643 { 644 setCurrentSubcommand(HELP_SCOPE_SNAPSHOT_LIST); 627 645 rc = handleSnapshotList(a, sessionMachine) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 646 } 628 647 else if (!strcmp(a->argv[1], "dump")) // undocumented parameter to debug snapshot info 629 648 DumpSnapshot(sessionMachine); 630 649 else 631 650 { 632 errorSyntax( USAGE_SNAPSHOT,"Invalid parameter '%s'", Utf8Str(a->argv[1]).c_str());651 errorSyntax("Invalid parameter '%s'", Utf8Str(a->argv[1]).c_str()); 633 652 rc = E_FAIL; 634 653 }
Note:
See TracChangeset
for help on using the changeset viewer.