From 0e77d3c51eaefc8b7c58f8134d0ffa0c3c9329fc Mon Sep 17 00:00:00 2001 From: cfillion Date: Wed, 27 Jul 2016 23:29:19 -0400 Subject: [PATCH] report: don't always use plural in the overview line --- src/report.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/report.cpp b/src/report.cpp index b263b17a..84fa3e7e 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -58,13 +58,19 @@ void Report::fillReport() const size_t removals = m_receipt.removals().size(); const size_t errors = m_receipt.errors().size(); - m_stream - << installs << " installed packages, " - << updates << " updates, " - << removals << " removed files and " - << errors << " errors" - << "\r\n" - ; + m_stream << installs << " installed package"; + if(installs != 1) m_stream << 's'; + + m_stream << ", " << updates << " update"; + if(updates != 1) m_stream << 's'; + + m_stream << ", " << removals << " removed file"; + if(removals != 1) m_stream << 's'; + + m_stream << " and " << errors << " error"; + if(errors != 1) m_stream << 's'; + + m_stream << "\r\n"; if(m_receipt.isRestartNeeded()) { m_stream