printInfo.unit = BunitB;
}
- if (vm.count("show-used"))
- printInfo.showUsed = true;
- else
- printInfo.showUsed = false;
+ printInfo.showUsed = vm.count("show-used");
if (vm.count("debug"))
debug = TRUE;
std::wstring output = L"DISK OK - free space:";
- if (printInfo.showUsed) {
+ if (printInfo.showUsed)
output = L"DISK OK - used space:";
- }
double tCap = 0, tFree = 0, tUsed = 0;
std::wcout << output;
if (vDrives.size() > 1) {
- if (printInfo.showUsed)
- std::wcout << "Total " << tUsed << unit << " (" << removeZero(std::round(tUsed / tCap * 100.0)) << "%); ";
-
- std::wcout << "Total " << tFree << unit << " (" << removeZero(std::round(tFree / tCap * 100.0)) << "%); ";
+ if (printInfo.showUsed) {
+ std::wcout << "Total " << (printInfo.showUsed ? tUsed : tFree) << unit
+ << " (" << removeZero(std::round(tUsed / tCap * 100.0)) << "%); ";
+ }
}
for (std::vector<std::wstring>::const_iterator it = wsDrives.begin(); it != wsDrives.end(); it++)
std::wcout << *it;
+
std::wcout << "|";
for (std::vector<std::wstring>::const_iterator it = wsPerf.begin(); it != wsPerf.end(); it++)
if (debug)
std::wcout << "\tAfter conversion: " << drive.free << '\n'
- << "\tused: " << tempUsed.QuadPart << '\n';
+ << "\tused: " << tempUsed.QuadPart << '\n';
drive.used = round((tempUsed.QuadPart / pow(1024.0, unit)));