Made output better readable
This commit is contained in:
parent
f7a17dff09
commit
1142f6749a
|
@ -1,8 +1,7 @@
|
|||
cmake_minimum_required (VERSION 3.7)
|
||||
project (mastobotmon
|
||||
VERSION 0.1.2
|
||||
LANGUAGES CXX
|
||||
)
|
||||
VERSION 0.1.3
|
||||
LANGUAGES CXX)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@ If you use a debug build, you get more verbose error messages.
|
|||
* [x] Allow to add accounts later
|
||||
* [ ] Write mentions to file
|
||||
* Version 0.3.0
|
||||
* [ ] Respect X-RateLimit header
|
||||
* [ ] Write statistics to file
|
||||
* Version 0.4.0
|
||||
* [ ] Daemon mode
|
||||
|
|
|
@ -98,7 +98,29 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (elapsed.count() > acc.get_minutes())
|
||||
{
|
||||
cout << "ALERT: " << acct << " is inactive since " << elapsed.count() << " minutes.\n";
|
||||
uint16_t minutes = elapsed.count();
|
||||
std::uint8_t hours = 0;
|
||||
std:: uint8_t days = 0;
|
||||
while (minutes >= 1440)
|
||||
{
|
||||
minutes -= 1440;
|
||||
days += 1;
|
||||
}
|
||||
while (minutes >= 60)
|
||||
{
|
||||
minutes -= 60;
|
||||
hours += 1;
|
||||
}
|
||||
cout << "ALERT: " << acct << " is inactive since ";
|
||||
if (days > 0)
|
||||
{
|
||||
cout << std::to_string(days) << " days, ";
|
||||
}
|
||||
if (hours > 0)
|
||||
{
|
||||
cout << std::to_string(hours) << " hours and ";
|
||||
}
|
||||
cout << std::to_string(minutes) << " minutes.\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue