openpomodoro-cli icon indicating copy to clipboard operation
openpomodoro-cli copied to clipboard

Unable to set a duration in XXmYYs format

Open pixelastic opened this issue 3 years ago • 1 comments

Hello,

The README mentions that one could set a custom duration in the XXmYYs format, but this doesn't seem to be implemented.

$ pomodoro start --duration 22m30s
Error: invalid argument "22m30s" for "-d, --duration" flag: strconv.ParseInt: parsing "22m30s": invalid syntax

I was looking for this feature to be able to implement my own "pause/resume" mechanism, where I would save the remaining time in a /tmp/ file before finishing a session, and resuming on the same duration when starting it over. This helps me for micro-interruption (a coworker asking a question that takes less than 30s to answer, and not breaking the flow too much).

But currently it seems that I cannot start a session with a finer granularity than minutes

pixelastic avatar May 30 '22 09:05 pixelastic

@pixelastic I chose to store the duration in minutes in the current/history files because I thought it was simpler to for people to read and edit them if needed. In practice though, I don't find myself editing it a lot. I'm not opposed to changing both the storage format and CLI args to use the Go duration syntax (and maybe support bare numbers as minutes for backward compatibility).

I'd love to add pausing into this tool itself, and would be happy to help implement it if you have an idea of how it would work. Are you planning to store a file with the time remaining, and then resume it? Does resuming change the pomodoro start time?

Writing this out for my own understanding:

  1. Start Pomodoro, start time is 10:00am, duration 25m.
  2. At 10:10 you pause. Duration remaining is 15m.
  3. At 10:15 you resume. The pause is removed and then...?

justincampbell avatar May 31 '22 14:05 justincampbell