Skip to content
Snippets Groups Projects
Commit 1f0706ce authored by Michael Davis's avatar Michael Davis
Browse files

[cta-admin] Fixes wrong column offset for MB/s column

parent bafb57a1
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,8 @@ namespace admin {
std::string TextFormatter::doubleToStr(double value, char unit) {
std::stringstream ss;
ss << std::fixed << std::setprecision(1) << value << unit;
ss << std::fixed << std::setprecision(1) << value;
if(unit != '\0') ss << unit;
return ss.str();
}
......@@ -92,9 +93,13 @@ void TextFormatter::flush() {
for(auto &l : m_outputBuffer) {
if(is_header) { std::cout << TEXT_RED; }
for(size_t c = 0; c < l.size(); ++c) {
// flush right, except for paths, which are flush left
auto flush = ((is_header && l.at(c) == "path") ||
l.at(c).substr(0,1) == "/") ? std::left : std::right;
std::cout << std::setfill(' ')
<< std::setw(m_colSize.at(c))
<< (c < l.size()-1 ? std::right : std::left)
<< flush
<< (l.at(c).empty() ? "-" : l.at(c))
<< ' ';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment