File tree Expand file tree Collapse file tree 2 files changed +61
-4
lines changed Expand file tree Collapse file tree 2 files changed +61
-4
lines changed Original file line number Diff line number Diff line change @@ -214,3 +214,36 @@ Seen at [discussions.apple.com/thread/8570915](
214
214
echo $task | tasklite importjson
215
215
done
216
216
```
217
+
218
+
219
+ ## Fixing Mistakes
220
+
221
+ It' s easy to write a short shell script to fix any mistakes
222
+ you might have made during the import process.
223
+
224
+ In following example I forgot to use the metadata field ` end`
225
+ to set the ` closed_utc` column, but used the current date instead.
226
+
227
+ As I deleted all metadata afterwards,
228
+ I now need to extract the field from an old backup.
229
+ In the meantime I changed some ` closed_utc` fields and therefore I can' t fully automate it.
230
+ A neat little trick I came up with is to automatically paste the correct value
231
+ into the clipboard, so I only have to insert it at the right location.
232
+
233
+ A [fish](https://fishshell.com/) script to fix the mistake could look like this:
234
+
235
+ ```fish
236
+ sqlite3 \
237
+ ~/TaskLite/main.db \
238
+ "SELECT ulid FROM tasks WHERE closed_utc LIKE ' %2024-02-26%' " \
239
+ | while read ulid \
240
+ ; echo "$ulid" \
241
+ ; and \
242
+ sqlite3 \
243
+ ~/TaskLite/backups/2024-02-14t1949.db \
244
+ "SELECT json_extract(metadata, ' \$ .end' ) FROM tasks WHERE ulid == ' $ulid ' " \
245
+ | tee /dev/tty \
246
+ | pbcopy \
247
+ ; and tl edit "$ulid" \
248
+ ; end
249
+ ```
Original file line number Diff line number Diff line change 5
5
---
6
6
7
7
8
+ ## Help
9
+
10
+ For a full overview of all supported subcommands run:
11
+
12
+ ``` sh
13
+ tasklite help
14
+ ```
15
+
16
+ ![ Screenshot of CLI output of ` help ` command] ( ../images/help.svg )
17
+
18
+
8
19
## Add
9
20
10
21
To add a task run:
@@ -30,15 +41,28 @@ The tags and special commands must be the last parameters,
30
41
but their order doesn't matter.
31
42
32
43
33
- ## Help
44
+ ## Edit
34
45
35
- For a full overview of all supported subcommands run :
46
+ Existing tasks can be easily edited in their YAML representation :
36
47
37
48
``` sh
38
- tasklite help
49
+ tl edit 01hwcw6s1kzakd5pje218zmtpt
39
50
```
40
51
41
- ![ Screenshot of CLI output of ` help ` command] ( ../images/help.svg )
52
+ This will open your default editor,
53
+ as specified in the environment variables ` $VISUAL ` or ` $EDITOR ` .
54
+ You can then easily edit existing fields and add new fields.
55
+
56
+ This feature allows for a powerful batch editing workflow.
57
+ Use an SQL query to select a subsection of your tasks
58
+ and then edit all of them one by one:
59
+
60
+ ``` bash
61
+ sqlite3 \
62
+ ~ /TaskLite/main.db \
63
+ " SELECT ulid FROM tasks WHERE metadata LIKE '%sprint%'" \
64
+ | while read ulid; do tl edit $ulid ; done
65
+ ```
42
66
43
67
44
68
## Context / Views
You can’t perform that action at this time.
0 commit comments