GothenburgBitFactory / GothenburgBitFactory/timewarrior
Add command `annotation`
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 117
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 5
Description
The command `annotation` is thought as a complement or replacement for the present command `annotate`.
### Synopsis
```
$ timew annotation set [...]
$ timew annotation add [...]
$ timew annotation show [...]
```
### Description
* Annotations can be set with the `set` subcommand:
```
$ timew start FOO
$ timew annotation set @1
Annotated @1 with ""
```
This would overwrite any present annotation.
* Deleting an annotation is done by setting it to an empty string
```
...
$ timew annotation set @1 ''
Removed annotation from @1
```
* The `annotation` command will have an `implicit @1`, i.e. if no `` is given, it will operate on the currently open interval if present:
```
$ timew start FOO
$ timew annotation set
Annotated @1 with ""
```
```
$ timew track FOO -
$ timew annotation set
At least one ID must be specified. See 'timew help annotation'.
```
* To add to an annotation, the `add` subcommand can be used:
```
$ timew start FOO
$ timew annotation set @1
...
$ timew annotation add @1
Annotated @1 with " "
```
The `` is appended with a separating space. If no annotation is present, the behaviour of `add` is equal to `set`.
* Annotations can be viewed with the `show` subcommand:
```
$ timew track FOO BAZ -
$ timew start BAR
$ timew annotate @2
...
$ timew annotation show @1 @2
Interval @2 [ - ] (FOO, BAZ) is annotated with
Interval @1 [ - ...] (BAR) is not annotated.
```
The command `annotate` would then either become a shortcut for `annotation set` or be replaced by it.
Also see updates to this in https://github.com/GothenburgBitFactory/timewarrior/issues/374#issuecomment-678317512
Contributor guide
Assessment
This issue has not been assessed yet.