From 4f1af722352b65e8775025084d8f95efbb3fb74a Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Mon, 27 Sep 2021 21:04:20 -0400 Subject: [PATCH] CmdNews: Filter out non-major news updates if displaying shortened summary --- src/commands/CmdNews.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/commands/CmdNews.cpp b/src/commands/CmdNews.cpp index 6b2432579..66eae65fd 100644 --- a/src/commands/CmdNews.cpp +++ b/src/commands/CmdNews.cpp @@ -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 (