Changeset 92372 in vbox for trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp
- Timestamp:
- Nov 11, 2021 2:45:18 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp
r82968 r92372 51 51 #endif /* !VBOX_ONLY_DOCS */ 52 52 53 DECLARE_TRANSLATION_CONTEXT(GuestProp); 54 55 53 56 void usageGuestProperty(PRTSTREAM pStrm, const char *pcszSep1, const char *pcszSep2) 54 57 { 55 RTStrmPrintf(pStrm, 56 "%s guestproperty %s get <uuid|vmname>\n" 57 " <property> [--verbose]\n" 58 "\n", pcszSep1, pcszSep2); 59 RTStrmPrintf(pStrm, 60 "%s guestproperty %s set <uuid|vmname>\n" 61 " <property> [<value> [--flags <flags>]]\n" 62 "\n", pcszSep1, pcszSep2); 63 RTStrmPrintf(pStrm, 64 "%s guestproperty %s delete|unset <uuid|vmname>\n" 65 " <property>\n" 66 "\n", pcszSep1, pcszSep2); 67 RTStrmPrintf(pStrm, 68 "%s guestproperty %s enumerate <uuid|vmname>\n" 69 " [--patterns <patterns>]\n" 70 "\n", pcszSep1, pcszSep2); 71 RTStrmPrintf(pStrm, 72 "%s guestproperty %s wait <uuid|vmname> <patterns>\n" 73 " [--timeout <msec>] [--fail-on-timeout]\n" 74 "\n", pcszSep1, pcszSep2); 58 RTStrmPrintf(pStrm, GuestProp::tr("%s guestproperty %s get <uuid|vmname>\n" 59 " <property> [--verbose]\n" 60 "\n"), pcszSep1, pcszSep2); 61 RTStrmPrintf(pStrm, GuestProp::tr("%s guestproperty %s set <uuid|vmname>\n" 62 " <property> [<value> [--flags <flags>]]\n" 63 "\n"), pcszSep1, pcszSep2); 64 RTStrmPrintf(pStrm, GuestProp::tr("%s guestproperty %s delete|unset <uuid|vmname>\n" 65 " <property>\n" 66 "\n"), pcszSep1, pcszSep2); 67 RTStrmPrintf(pStrm, GuestProp::tr("%s guestproperty %s enumerate <uuid|vmname>\n" 68 " [--patterns <patterns>]\n" 69 "\n"), pcszSep1, pcszSep2); 70 RTStrmPrintf(pStrm, GuestProp::tr("%s guestproperty %s wait <uuid|vmname> <patterns>\n" 71 " [--timeout <msec>] [--fail-on-timeout]\n" 72 "\n"), pcszSep1, pcszSep2); 75 73 } 76 74 … … 87 85 verbose = true; 88 86 else if (a->argc != 2) 89 return errorSyntax(USAGE_GUESTPROPERTY, "Incorrect parameters");87 return errorSyntax(USAGE_GUESTPROPERTY, GuestProp::tr("Incorrect parameters")); 90 88 91 89 ComPtr<IMachine> machine; … … 107 105 &i64Timestamp, flags.asOutParam())); 108 106 if (value.isEmpty()) 109 RTPrintf( "No value set!\n");107 RTPrintf(GuestProp::tr("No value set!\n")); 110 108 else 111 RTPrintf( "Value: %ls\n", value.raw());109 RTPrintf(GuestProp::tr("Value: %ls\n"), value.raw()); 112 110 if (!value.isEmpty() && verbose) 113 111 { 114 RTPrintf( "Timestamp: %lld\n", i64Timestamp);115 RTPrintf( "Flags: %ls\n", flags.raw());112 RTPrintf(GuestProp::tr("Timestamp: %lld\n"), i64Timestamp); 113 RTPrintf(GuestProp::tr("Flags: %ls\n"), flags.raw()); 116 114 } 117 115 } … … 146 144 usageOK = false; 147 145 if (!usageOK) 148 return errorSyntax(USAGE_GUESTPROPERTY, "Incorrect parameters");146 return errorSyntax(USAGE_GUESTPROPERTY, GuestProp::tr("Incorrect parameters")); 149 147 /* This is always needed. */ 150 148 pszName = a->argv[1]; … … 190 188 usageOK = false; 191 189 if (!usageOK) 192 return errorSyntax(USAGE_GUESTPROPERTY, "Incorrect parameters");190 return errorSyntax(USAGE_GUESTPROPERTY, GuestProp::tr("Incorrect parameters")); 193 191 /* This is always needed. */ 194 192 pszName = a->argv[1]; … … 232 230 && strcmp(a->argv[1], "--patterns") 233 231 && strcmp(a->argv[1], "-patterns"))) 234 return errorSyntax(USAGE_GUESTPROPERTY, "Incorrect parameters");232 return errorSyntax(USAGE_GUESTPROPERTY, GuestProp::tr("Incorrect parameters")); 235 233 236 234 /* … … 268 266 { 269 267 if (names.size() == 0) 270 RTPrintf( "No properties found.\n");268 RTPrintf(GuestProp::tr("No properties found.\n")); 271 269 for (unsigned i = 0; i < names.size(); ++i) 272 RTPrintf( "Name: %ls, value: %ls, timestamp: %lld, flags: %ls\n",270 RTPrintf(GuestProp::tr("Name: %ls, value: %ls, timestamp: %lld, flags: %ls\n"), 273 271 names[i], values[i], timestamps[i], flags[i]); 274 272 } … … 319 317 } 320 318 if (!usageOK) 321 return errorSyntax(USAGE_GUESTPROPERTY, "Incorrect parameters");319 return errorSyntax(USAGE_GUESTPROPERTY, GuestProp::tr("Incorrect parameters")); 322 320 323 321 /* … … 374 372 gpcev->COMGETTER(Value)(aNextValue.asOutParam()); 375 373 gpcev->COMGETTER(Flags)(aNextFlags.asOutParam()); 376 RTPrintf( "Name: %ls, value: %ls, flags: %ls\n",374 RTPrintf(GuestProp::tr("Name: %ls, value: %ls, flags: %ls\n"), 377 375 aNextName.raw(), aNextValue.raw(), aNextFlags.raw()); 378 376 fSignalled = true; … … 391 389 if (!fSignalled) 392 390 { 393 RTMsgError( "Time out or interruption while waiting for a notification.");391 RTMsgError(GuestProp::tr("Time out or interruption while waiting for a notification.")); 394 392 if (fFailOnTimeout) 395 393 /* Hysterical rasins: We always returned 2 here, which now translates to syntax error... Which is bad. */ … … 417 415 418 416 if (a->argc == 0) 419 return errorSyntax(USAGE_GUESTPROPERTY, "Incorrect parameters");417 return errorSyntax(USAGE_GUESTPROPERTY, GuestProp::tr("Incorrect parameters")); 420 418 421 419 /* switch (cmd) */ … … 432 430 433 431 /* default: */ 434 return errorSyntax(USAGE_GUESTPROPERTY, "Incorrect parameters");432 return errorSyntax(USAGE_GUESTPROPERTY, GuestProp::tr("Incorrect parameters")); 435 433 } 436 434
Note:
See TracChangeset
for help on using the changeset viewer.