fnogatz / clocker

Command-line tool to track project hours
Other
420 stars 31 forks source link

Calling `clocker stop` twice, updates the end timestamp of the last entry #13

Closed schmkr closed 4 years ago

schmkr commented 10 years ago

Hi,

I just noticed some weird behaviour when calling clocker stop twice. I do this, to make sure no other timers are running (because it is possible to have multiple timers running, see #11).

The second time clocker stop is called, but there is no timer running, it updates the end timestamp of the last entry.

I think this should not happen and clocker should only update the timestamp for a running task.

fnogatz commented 9 years ago

The second time clocker stop is called, but there is no timer running, it updates the end timestamp of the last entry.

For me this is a feature not a bug. I only have running a single clocker timer, so this is a nice way to update the last end time instead of using clocker set. Would fixing #11 in the way that only a single clocker timer can be started appropriate for you?

wullxz commented 9 years ago

I'd be happy if clocker at least asks if I really want to start two timers and maybe also asks which timer to stop when multiple timers are running. Maybe some people really use the possibility to start multiple timers...

fnogatz commented 9 years ago

@substack What's the intended way? Being able to start multiple timers or to re-stop one via clocker stop?

rogeruiz commented 9 years ago

I've run into this issue since integrating clocker into my tmux workflow. I would appreciate being able to stop specific timers based on the argument -t TYPE.

Any direction on contributing to the project would be helpful. I don't mind helping out in any to get this fixed.

fnogatz commented 4 years ago

Alright, as of v1.17.0 clocker supports the --type, -t option for clocker stop. I.e., it is now possible to stop specific timers based on their type.

The other thing discussed in this issue was on how to handle multiple clocker stop calls. I still stand with https://github.com/substack/clocker/issues/13#issuecomment-71047832 to consider this a feature and not bug, so clocker stop can be used to update a previously stopped entry.