mrusme / zeit

Zeit, erfassen. A command line tool for tracking time spent on activities.
https://マリウス.com/zeit-erfassen-a-cli-activity-time-tracker/
GNU General Public License v3.0
226 stars 18 forks source link

Renaming tasks/projects? #28

Closed selfire1 closed 1 year ago

selfire1 commented 1 year ago

Hi! Thank you for this great tool. I love how simple yet powerful Zeit is.

As I've been using it more and more, I got a better grasp of how to use projects and tasks. My previous setup is a bit messy and I'l like to refactor the task and project names and associations. I tried opening zeit.db in a text editor and just search and replaced all instances of a project name to a new one. However, that broke the database.

Is there a way to bulk rename or is manually updating each entry the way to go?

Thanks again for your hard work on Zeit!

mrusme commented 1 year ago

Hey there, glad you enjoy Zeit. See, that's the beauty of the CLI, you don't necessarily need the tool to support features like bulk updates since you can easily perform those on your own, e.g.:

zeit --no-colors list -p Kenya | cut -d ' ' -f1 | xargs -I {} echo zeit entry -p Nairobi {}

Replace Kenya with the old project name and Nairobi with the new one. Run it and check if what it would do looks alright. If so, backup your zeit.db nevertheless, remove the echo, run it and Bob's your uncle.

Hope this helps! Feel free to reopen if further issues come up.