- Timestamp:
- May 27, 2015 1:12:03 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r55182 r56099 360 360 int iCmd = 1; 361 361 int iCmdArg; 362 const char * g_pszSettingsPw = NULL;363 const char * g_pszSettingsPwFile = NULL;362 const char *pszSettingsPw = NULL; 363 const char *pszSettingsPwFile = NULL; 364 364 365 365 for (int i = 1; i < argc || argc <= iCmd; i++) … … 367 367 if ( argc <= iCmd 368 368 || !strcmp(argv[i], "help") 369 || !strcmp(argv[i], "--help") 369 370 || !strcmp(argv[i], "-?") 370 371 || !strcmp(argv[i], "-h") 371 || !strcmp(argv[i], "-help") 372 || !strcmp(argv[i], "--help")) 372 || !strcmp(argv[i], "-help")) 373 373 { 374 374 if (i >= argc - 1) … … 384 384 } 385 385 386 if ( !strcmp(argv[i], "-v") 387 || !strcmp(argv[i], "-version") 388 || !strcmp(argv[i], "-Version") 389 || !strcmp(argv[i], "--version")) 386 if ( !strcmp(argv[i], "-V") 387 || !strcmp(argv[i], "--version") 388 || !strcmp(argv[i], "-v") /* deprecated */ 389 || !strcmp(argv[i], "-version") /* deprecated */ 390 || !strcmp(argv[i], "-Version") /* deprecated */) 390 391 { 391 392 /* Print version number, and do nothing else. */ 392 RTPrintf("%sr% d\n", VBOX_VERSION_STRING, RTBldCfgRevision());393 RTPrintf("%sr%u\n", VBOX_VERSION_STRING, RTBldCfgRevision()); 393 394 return 0; 394 395 } 395 396 396 397 if ( !strcmp(argv[i], "--dumpopts") 397 || !strcmp(argv[i], "-dumpopts") )398 || !strcmp(argv[i], "-dumpopts") /* deprecated */) 398 399 { 399 400 /* Special option to dump really all commands, … … 404 405 405 406 if ( !strcmp(argv[i], "--nologo") 406 || !strcmp(argv[i], "- nologo")407 || !strcmp(argv[i], "- q"))407 || !strcmp(argv[i], "-q") 408 || !strcmp(argv[i], "-nologo") /* deprecated */) 408 409 { 409 410 /* suppress the logo */ … … 420 421 else if (!strcmp(argv[i], "--settingspw")) 421 422 { 423 if (i >= argc - 1) 424 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Password expected"); 425 /* password for certain settings */ 426 pszSettingsPw = argv[i + 1]; 427 iCmd += 2; 428 } 429 else if (!strcmp(argv[i], "--settingspwfile")) 430 { 422 431 if (i >= argc-1) 423 return RTMsgErrorExit(RTEXITCODE_FAILURE, 424 "Password expected"); 425 /* password for certain settings */ 426 g_pszSettingsPw = argv[i+1]; 427 iCmd += 2; 428 } 429 else if (!strcmp(argv[i], "--settingspwfile")) 430 { 431 if (i >= argc-1) 432 return RTMsgErrorExit(RTEXITCODE_FAILURE, 433 "No password file specified"); 434 g_pszSettingsPwFile = argv[i+1]; 432 return RTMsgErrorExit(RTEXITCODE_FAILURE, "No password file specified"); 433 pszSettingsPwFile = argv[i+1]; 435 434 iCmd += 2; 436 435 } … … 575 574 }; 576 575 577 if ( g_pszSettingsPw)576 if (pszSettingsPw) 578 577 { 579 578 int rc; 580 CHECK_ERROR(virtualBox, SetSettingsSecret(Bstr( g_pszSettingsPw).raw()));579 CHECK_ERROR(virtualBox, SetSettingsSecret(Bstr(pszSettingsPw).raw())); 581 580 if (FAILED(rc)) 582 581 { … … 585 584 } 586 585 } 587 else if ( g_pszSettingsPwFile)588 { 589 rcExit = settingsPasswordFile(virtualBox, g_pszSettingsPwFile);586 else if (pszSettingsPwFile) 587 { 588 rcExit = settingsPasswordFile(virtualBox, pszSettingsPwFile); 590 589 if (rcExit != RTEXITCODE_SUCCESS) 591 590 break;
Note:
See TracChangeset
for help on using the changeset viewer.