Skip to content

Commit

Permalink
report: don't always use plural in the overview line
Browse files Browse the repository at this point in the history
  • Loading branch information
cfillion committed Jul 28, 2016
1 parent 73b267e commit 0e77d3c
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0e77d3c

Please sign in to comment.