jazzband / Watson

:watch: A wonderful CLI to track your time!
http://tailordev.github.io/Watson/
MIT License
2.44k stars 239 forks source link

Split one tag into multiple via `rename` #465

Open addisonklinke opened 2 years ago

addisonklinke commented 2 years ago

Say I create a frame

watson start personal +lunch
watson stop
watson log

Wednesday 23 March 2022 (10m 04s)
    f4beec9  07:27 to 07:38      10m 04s      personal  [lunch]

Now I have several of these over the past two weeks. I decide I want the tags to be [meals, lunch] instead of just [lunch]. Currently watson rename only supports [lunch] --> [meals] but doesn't have append a meals tag everywhere there is a lunch one. I've tried

watson rename tag lunch "meals, lunch"        # Looks okay in log, but JSON is wrong so reports would be off
watson rename tag lunch '"meals", \n"lunch"'  # Garbled JSON, bad idea

Aside from using the frame hashes from log to do watson edit [hash] for everything manually, is there some way this kind of operation could be supported within rename? Perhaps the following could clarify single tag vs. multiple

watson rename tag lunch "[meals, lunch]"

Here brackets mean "interpret elements as a list of tags to replace lunch with"