dominikbraun / timetrace

A simple CLI for tracking your working time.
Apache License 2.0
679 stars 75 forks source link

`timetrace delete` commands: Default to `no` when asking for confirmation #110

Open dominikbraun opened 3 years ago

dominikbraun commented 3 years ago

When running a delete command, the user will be asked for confirmation:

timetrace delete record 2021-06-08-12-56
+---------+-------+-----------+------------+
|  START  |  END  |  PROJECT  |  BILLABLE  |
+---------+-------+-----------+------------+
| 12:56   | 16:38 | web-store | no         |
+---------+-------+-----------+------------+
Please confirm (Y/N):
...

The input has to be exactly n or y. This is done using askForConfirmation().


However, it would make sense to default to no.

jwnpoh commented 3 years ago

Hello, may I take this up?

Am I correct in my understanding that this issue just requires some work specifically on askForCorfirmation()?

jwnpoh commented 3 years ago

Hello, I was looking at cli/delete.go and noticed that askForConfirmation() is only used in delete record but not delete project. Is this by design, or should delete project also include a prompt for confirmation?

dominikbraun commented 3 years ago

Am I correct in my understanding that this issue just requires some work specifically on askForCorfirmation()?

Absolutely. I think this is the only place where the user is asked for confirmation.

I was looking at cli/delete.go and noticed that askForConfirmation() is only used in delete record but not delete project. Is this by design, or should delete project also include a prompt for confirmation?

Good point, the user should probably prompted for confirmation when deleting a project as well!