zyedidia / eget

Easily install prebuilt binaries from GitHub.
MIT License
866 stars 39 forks source link

feat(rate): also display reset time as duration from now when available #86

Closed hhromic closed 10 months ago

hhromic commented 10 months ago

While testing eget, I hit the rate limit (without token) of GitHub and thought it would be a nicer UX to not only show at which date the rate limit will be reset but also a duration to that date from now.

With this PR, eget shows the following message when the rate limit is exhausted:

$ eget --rate
Limit: 60, Remaining: 0, Reset: 2023-10-21 23:06:19 +0100 IST (20m42s)

And this message when it is not (e.g. using a token):

$ eget --rate
Limit: 5000, Remaining: 5000, Reset: 2023-10-21 23:57:48 +0100 IST