Merge "adb: make the push summary fit in 80 columns."

This commit is contained in:
Elliott Hughes 2020-01-30 16:01:01 +00:00 committed by Gerrit Code Review
commit b2066fda6d

View file

@ -187,14 +187,13 @@ struct TransferLedger {
const char* direction_str = (direction == TransferDirection::push) ? "pushed" : "pulled"; const char* direction_str = (direction == TransferDirection::push) ? "pushed" : "pulled";
std::stringstream ss; std::stringstream ss;
if (!name.empty()) { if (!name.empty()) {
ss << name << ": "; std::string_view display_name(name);
char* out = getenv("ANDROID_PRODUCT_OUT");
if (out) android::base::ConsumePrefix(&display_name, out);
ss << display_name << ": ";
} }
ss << files_transferred << " file" << ((files_transferred == 1) ? "" : "s") << " " ss << files_transferred << " file" << ((files_transferred == 1) ? "" : "s") << " "
<< direction_str << "."; << direction_str << ", " << files_skipped << " skipped.";
if (files_skipped > 0) {
ss << " " << files_skipped << " file" << ((files_skipped == 1) ? "" : "s")
<< " skipped.";
}
ss << TransferRate(); ss << TransferRate();
lp.Print(ss.str(), LinePrinter::LineType::INFO); lp.Print(ss.str(), LinePrinter::LineType::INFO);