CmdNews: Filter out non-major news updates if displaying shortened summary

This commit is contained in:
Tomas Babej 2021-09-27 21:04:20 -04:00
parent 1935cd7e2d
commit 4f1af72235

View file

@ -154,6 +154,13 @@ int CmdNews::execute (std::string& output)
signal (SIGINT, SIG_DFL);
bool full_summary = matches.size () == 1 && matches[0] == "full" ? true : false;
// Remove non-major items if displaying a non-full (abbreviated) summary
if (! full_summary)
items.erase (
std::remove_if (items.begin (), items.end (), [](const NewsItem& n){return n._major == false;}),
items.end ()
);
// Print release notes
Color bold = Color ("bold");
std::cout << bold.colorize (