rasctl output update (#357)

This commit is contained in:
Uwe Seimet 2021-10-21 02:55:48 +02:00 committed by GitHub
parent a47588ab22
commit dbaf5dcd30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,9 +41,9 @@ string ras_util::ListDevices(const list<PbDevice>& pb_devices)
}
ostringstream s;
s << "+----+----+------+-------------------------------------" << endl
<< "| ID | UN | TYPE | DEVICE STATUS" << endl
<< "+----+----+------+-------------------------------------" << endl;
s << "+----+-----+------+-------------------------------------" << endl
<< "| ID | LUN | TYPE | IMAGE FILE" << endl
<< "+----+-----+------+-------------------------------------" << endl;
list<PbDevice> devices = pb_devices;
devices.sort([](const auto& a, const auto& b) { return a.id() < b.id() && a.unit() < b.unit(); });
@ -64,13 +64,13 @@ string ras_util::ListDevices(const list<PbDevice>& pb_devices)
break;
}
s << "| " << device.id() << " | " << device.unit() << " | " << PbDeviceType_Name(device.type()) << " | "
s << "| " << device.id() << " | " << device.unit() << " | " << PbDeviceType_Name(device.type()) << " | "
<< (filename.empty() ? "NO MEDIA" : filename)
<< (!device.status().removed() && (device.properties().read_only() || device.status().protected_()) ? " (WRITEPROTECT)" : "")
<< (!device.status().removed() && (device.properties().read_only() || device.status().protected_()) ? " (READ-ONLY)" : "")
<< endl;
}
s << "+----+----+------+-------------------------------------";
s << "+----+-----+------+-------------------------------------";
return s.str();
}