mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 19:03:07 +02:00
CmdCustom: Increase probability of displaying upgrade message
We have received reports from people that have upgraded, but seemingly have not seen release notes in the `task news` command. One of the causes here could be the fact that the probability of displaying the footnote about running `task news` is `1/10`. Increase the probability to 1/4.
This commit is contained in:
parent
dc81bf5fb5
commit
072b38d326
1 changed files with 2 additions and 2 deletions
|
@ -254,7 +254,7 @@ int CmdCustom::execute (std::string& output)
|
|||
{
|
||||
std::random_device device;
|
||||
std::mt19937 random_generator(device());
|
||||
std::uniform_int_distribution<std::mt19937::result_type> ten_percent(1, 10);
|
||||
std::uniform_int_distribution<std::mt19937::result_type> twentyfive_percent(1, 4);
|
||||
|
||||
std::string NEWS_NOTICE = (
|
||||
"Recently upgraded to 2.6.0. "
|
||||
|
@ -262,7 +262,7 @@ int CmdCustom::execute (std::string& output)
|
|||
);
|
||||
|
||||
// 1 in 10 chance to display the message.
|
||||
if (ten_percent(random_generator) == 10)
|
||||
if (twentyfive_percent(random_generator) == 4)
|
||||
{
|
||||
if (Context::getContext ().verbose ("footnote"))
|
||||
Context::getContext ().footnote (NEWS_NOTICE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue