samg / timetrap

Simple command line timetracker
http://rubygems.org/gems/timetrap
Other
1.48k stars 116 forks source link

Add edit option to clear note #205

Closed fbuys closed 2 years ago

fbuys commented 2 years ago

Description

Closes: https://github.com/samg/timetrap/issues/164

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.

Motivation and Context

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.

How Has This Been Tested?

Added specs.

Created an entry with a note and cleared it with both -c and --clear. Also turned note_editor on and confirmed that notes are cleared without the note editor opening again.

Types of changes

Checklist: