GothenburgBitFactory / GothenburgBitFactory/taskwarrior

Distinguish between mod and add commands when encountering attribute removal

Open
#2,365 1 comment 0 reactions 0 assignees View on GitHub
triaged type:enhancement
Dominant language
C++
Stars
6.1k
Forks
423
Avg merge
1d 19h
Merged PRs (30d)
11

Description

Followup from #2241.

Taskwarrior uses syntax `task mod attribute:` to remove a given attribute from the task, i.e. `task 1 mod project:`. However, there are cases when attribute names can appear (accidentally) in task descriptions:

```
root@799730228f65:/# task add We should wait: until: the year is over
root@799730228f65:/# task add Get back to T re: rent and wifi
root@799730228f65:/# task 1 info
Name Value
ID 1
Description We should the year is over
Status Pending
Entered 2020-12-07 02:46:10 (13s)
Last modified 2020-12-07 02:46:10 (13s)
Virtual tags PENDING READY UNBLOCKED LATEST
UUID 9603e7b5-c1ba-4861-80cc-b2155070593f
Urgency 0

root@799730228f65:/# task ls
ID Tags Description
2 Get back to T rent and wifi
1 We should the year is over
```

I'd argue in this case TW should be able to determine that with `add` command, there is really no value of `wait` or `until` to erase, and hence should keep that particular token as part of the description.

However, for attributes with default values, the current functionality should be preserved:
```
root@799730228f65:/# task add Fix the project: issue
root@799730228f65:/# task 4 info

Name Value
ID 4
Description Fix the issue
Status Pending
Entered 2020-12-07 02:49:44 (2s)
Last modified 2020-12-07 02:49:44 (2s)
Virtual tags PENDING READY UNBLOCKED LATEST
UUID 8ab73333-163b-4dfd-aeff-f066edf60952
Urgency 0

root@799730228f65:/# task add Fix the issue
Created task 5.
The project 'Inbox' has changed. Project 'Inbox' is 0% complete (1 task remaining).
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.