Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot remove note #164

Closed
Huluk opened this issue Sep 12, 2017 · 4 comments · Fixed by #205
Closed

Cannot remove note #164

Huluk opened this issue Sep 12, 2017 · 4 comments · Fixed by #205

Comments

@Huluk
Copy link

Huluk commented Sep 12, 2017

It does not seem possible to remove a note once it is added.
I tried to use t edit '' and variations of it, but the note remains.

Current workaround:
t edit with a zero-width space as argument at least removes any visible notes.

@jostber
Copy link

jostber commented Sep 12, 2017

Is it the same if you edit the note with the editor option?

@samg
Copy link
Owner

samg commented Sep 13, 2017

You can use the t kill --id command to delete entries. There's more detailed usage info in the Readme.

@samg samg closed this as completed Sep 13, 2017
@Huluk
Copy link
Author

Huluk commented Sep 13, 2017

@jostber Thank you for drawing my attention to the editor, it is indeed possible to remove a note with it.

@samg the kill command does only solve the problem in a very complicated manner – if I want to remove the note from an older entry, I have to write down its start and end time, kill the entry, then recreate it using t in --at $OLD_START_TIME and t out --at $OLD_END_TIME. Possible, but complicated.
Both changing config and the workaround with kill are quite complicated, so I'd prefer to re-open this issue. I am not at all opposed to fixing the problem myself, I just have not found the time yet to figure out how the edit code works.

@samg
Copy link
Owner

samg commented Sep 17, 2017

Sorry misunderstood your issue. I see the current semantics of the CLI make it impossible to blank out a note, though the editor option provides a nice workaround.

I'm happy to reopen the issue and review any PRs that would address this.

Thanks!

@samg samg reopened this Sep 17, 2017
fbuys added a commit to fbuys/timetrap that referenced this issue Sep 14, 2021
Closes: samg#164

The regex used to see if a note has been provided cannot find empty
strings. It is therefore not possible to look for empty string to clear
a note.

Instead a new flag (-c or --clear) clears the last entry's note or it
can be used with the -i flag to clear another entry's note.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants