> From: Daniel Jay Haskin <daniel.haskin@angel.com>> > ---> src/client/handlers.rs | 3 ++-> 1 file changed, 2 insertions(+), 1 deletion(-)> > diff --git a/src/client/handlers.rs b/src/client/handlers.rs> index de81afd..55ffac9 100644> --- a/src/client/handlers.rs> +++ b/src/client/handlers.rs> @@ -16,7 +16,8 @@ pub fn get(client: &dyn Client) -> Result<()> {> TimerState::Running if timer.cycle.duration < 60 => {> println!("[{cycle}] {}s", timer.cycle.duration)> }> - TimerState::Running => println!("[{cycle}] {}min", timer.cycle.duration / 60),> + TimerState::Running => println!("[{cycle}] {}min {}s", timer.cycle.duration / 60,> + timer.cycle.duration % 60),> };> > Ok(())> -- > 2.34.1
Thank you for the patch. I initially did not show the seconds not to
"pollute" too much the timer, but it is my personal opinion. Instead it
could be great to add an option to customize the output, what do you
think?
> Thank you for the patch. I initially did not show the seconds not to> "pollute" too much the timer, but it is my personal opinion. Instead it> could be great to add an option to customize the output, what do you> think?
I almost think that customizing output is too much, most people don't
need that. Maybe just an option to show the seconds, with it off by default.
> I almost think that customizing output is too much, most people don't > need that. Maybe just an option to show the seconds, with it off by> default.
Yes, you right. Let's do this instead. Thank you for your feedback :)
>> I almost think that customizing output is too much, most people don't >> need that. Maybe just an option to show the seconds, with it off by>> default.> > Yes, you right. Let's do this instead. Thank you for your feedback :)
I introduced a new option `timer-precision` that can take 3 values:
- `second`: Sets the precision to seconds, which shows hour and/or
minutes and/or seconds (the one you would like)
- `minute` (default): Sets the precision to minutes. If the timer < 60,
shows seconds, otherwise shows hours and/or minutes.
- `hour`: Sets the precision to hours. If the timer < 3600,
shows minutes and/or seconds, otherwise shows hours only.