control:fanctl - Update `get` output formatting
Fix up fan feedback alignment for fans with more than one rotor.
Change-Id: Icf574647a7ebbebf5c684aadd106e8e40f320b24
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/fanctl.cpp b/control/fanctl.cpp
index e40c61e..3e6591f 100644
--- a/control/fanctl.cpp
+++ b/control/fanctl.cpp
@@ -393,29 +393,27 @@
// print just the sensor name
auto shortPath = pathMap["tach"][fan][0];
shortPath = justFanName(shortPath);
- cout << shortPath << setw(18);
+ cout << setw(13) << std::left << shortPath << std::right << setw(15);
// print its target RPM/PWM
property = "Target";
cout << SDBusPlus::getProperty<uint64_t>(
- pathMap["tach"][fan][0],
- interfaces[ifaceTypeFromMethod(method)], property)
- << setw(12) << " ";
+ pathMap["tach"][fan][0], interfaces[ifaceTypeFromMethod(method)],
+ property);
// print readings for each rotor
property = "Value";
- auto indent = 0U;
+ auto indent = 0;
for (auto& path : pathMap["tach"][fan])
{
- cout << setw(indent);
- cout << justFanName(path) << setw(16)
+ cout << setw(18 + indent) << justFanName(path) << setw(17)
<< SDBusPlus::getProperty<double>(
path, interfaces["SensorValue"], property)
<< endl;
if (0 == indent)
- indent = 42;
+ indent = 28;
}
}
}