CmdNews: Dynamically construct the heading

This commit is contained in:
Tomas Babej 2021-10-02 11:45:59 -04:00
parent 333840062b
commit f9f62d596a
No known key found for this signature in database
GPG key ID: B0747C6578F7D2F5

View file

@ -495,6 +495,7 @@ int CmdNews::execute (std::string& output)
// TODO: 2.6.0 is the only version with explicit release notes, but in the
// future we need to only execute yet unread release notes
std::vector<NewsItem> items;
std::string version = "2.6.0";
version2_6_0 (items);
bool full_summary = false;
@ -529,12 +530,14 @@ int CmdNews::execute (std::string& output)
// Print release notes
Color bold = Color ("bold");
std::cout << bold.colorize (
std::cout << bold.colorize (format (
"\n"
"====================================\n"
"Taskwarrior 2.6.0 Release highlights\n"
"====================================\n"
);
"==========================================\n"
"Taskwarrior {1} {2} Release highlights\n"
"==========================================\n",
version,
(full_summary ? "All" : (major_items ? "Major" : "Minor"))
));
for (unsigned short i=0; i < items.size (); i++) {
std::cout << format ("\n({1}/{2}) ", i+1, items.size ());