Changeset 99266 in vbox
- Timestamp:
- Apr 3, 2023 3:56:00 PM (22 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/en_US/man_VBoxManage-guestcontrol.xml
r99264 r99266 270 270 <arg>--human-readable</arg> 271 271 <arg>--quiet</arg> 272 <arg>--total</arg> 272 273 <arg>--username=<replaceable>username</replaceable></arg> 273 274 <arg>--verbose</arg> … … 813 814 <listitem><para> 814 815 Shows the disk sizes in a human readable form. 816 </para> 817 </listitem> 818 </varlistentry> 819 <varlistentry> 820 <term><option>--total</option></term> 821 <listitem><para> 822 Produces a grand total of all disk sizes. 815 823 </para> 816 824 </listitem> -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r99264 r99266 2389 2389 AssertPtrReturn(pCtx, RTEXITCODE_FAILURE); 2390 2390 2391 /* 2392 * Parse arguments. 2393 */ 2394 enum GCTLCMD_FSINFO_OPT 2395 { 2396 GCTLCMD_FSINFO_OPT_TOTAL = 1000 2397 }; 2398 2391 2399 static const RTGETOPTDEF s_aOptions[] = 2392 2400 { 2393 2401 GCTLCMD_COMMON_OPTION_DEFS() 2394 { "--human-readable", 'h', RTGETOPT_REQ_NOTHING } 2402 { "--human-readable", 'h', RTGETOPT_REQ_NOTHING }, 2403 { "--total", GCTLCMD_FSINFO_OPT_TOTAL, RTGETOPT_REQ_NOTHING } 2395 2404 }; 2396 2405 … … 2401 2410 2402 2411 bool fHumanReadable = false; 2412 bool fShowTotal = false; 2403 2413 2404 2414 while ( (ch = RTGetOpt(&GetState, &ValueUnion)) != 0 … … 2412 2422 case 'h': 2413 2423 fHumanReadable = true; 2424 break; 2425 2426 case GCTLCMD_FSINFO_OPT_TOTAL: 2427 fShowTotal = true; 2414 2428 break; 2415 2429 … … 2439 2453 cwPathSpacing, "", 2440 2454 GuestCtrl::tr("Path")); 2455 2456 uint64_t cbTotalSize = 0; 2457 uint64_t cbTotalFree = 0; 2441 2458 2442 2459 while (ch == VINF_GETOPT_NOT_OPTION) … … 2477 2494 ValueUnion.psz); /* Path */ 2478 2495 } 2496 2497 if (fShowTotal) 2498 { 2499 cbTotalSize += u64; 2500 cbTotalFree += u64_2; 2501 } 2502 2479 2503 RTPrintf("\n"); 2480 2504 } … … 2482 2506 /* Next path. */ 2483 2507 ch = RTGetOpt(&GetState, &ValueUnion); 2508 } 2509 2510 if (fShowTotal) 2511 { 2512 if (fHumanReadable) 2513 { 2514 RTPrintf("%-*s%*Rhcb%*Rhcb%*Rhcb%*s%s", 2515 cwFileSys, "total", 2516 cwSizeTotal, cbTotalSize, /* Total */ 2517 cwSizeUsed, cbTotalSize - cbTotalFree, /* Used */ 2518 cwSizeAvail, cbTotalFree, /* Available */ 2519 cwPathSpacing, "", 2520 "-"); /* Path */ 2521 } 2522 else 2523 { 2524 RTPrintf("%-*s%*RU64%*RU64%*RU64%*s%s", 2525 cwFileSys, "total", /* Filesystem */ 2526 cwSizeTotal, cbTotalSize, /* Total */ 2527 cwSizeUsed, cbTotalSize - cbTotalFree, /* Used */ 2528 cwSizeAvail, cbTotalFree, /* Available */ 2529 cwPathSpacing, "", 2530 "-"); /* Path */ 2531 } 2532 RTPrintf("\n"); 2484 2533 } 2485 2534
Note:
See TracChangeset
for help on using the changeset viewer.