@nijaru/tk 0.0.5 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,440 +0,0 @@
1
- export const BASH_COMPLETION = `# bash completion for tk
2
-
3
- _tk_task_ids() {
4
- local tasks_dir
5
- tasks_dir="$(git rev-parse --show-toplevel 2>/dev/null)/.tasks"
6
- if [[ -d "$tasks_dir" ]]; then
7
- find "$tasks_dir" -maxdepth 1 -name '*.json' ! -name 'config.json' -exec basename {} .json \\; 2>/dev/null
8
- fi
9
- }
10
-
11
- _tk() {
12
- local cur prev words cword
13
- _init_completion || return
14
-
15
- local commands="init add ls list ready show start done reopen edit log block unblock mv move rm remove clean check config completions help"
16
- local global_opts="--json --help -h --version -V"
17
-
18
- # Find the command (first non-option word after 'tk')
19
- local cmd=""
20
- local i
21
- for ((i=1; i < cword; i++)); do
22
- if [[ \${words[i]} != -* ]]; then
23
- cmd="\${words[i]}"
24
- break
25
- fi
26
- done
27
-
28
- # Complete command if no command yet
29
- if [[ -z "$cmd" ]]; then
30
- if [[ "$cur" == -* ]]; then
31
- COMPREPLY=($(compgen -W "$global_opts" -- "$cur"))
32
- else
33
- COMPREPLY=($(compgen -W "$commands" -- "$cur"))
34
- fi
35
- return
36
- fi
37
-
38
- # Complete based on command
39
- case "$cmd" in
40
- add)
41
- if [[ "$cur" == -* ]]; then
42
- COMPREPLY=($(compgen -W "-p --priority -P --project -d --description -l --labels -A --assignees --parent --estimate --due --json" -- "$cur"))
43
- elif [[ "$prev" == "-p" || "$prev" == "--priority" ]]; then
44
- COMPREPLY=($(compgen -W "0 1 2 3 4 p0 p1 p2 p3 p4 none urgent high medium low" -- "$cur"))
45
- fi
46
- ;;
47
- ls|list)
48
- if [[ "$cur" == -* ]]; then
49
- COMPREPLY=($(compgen -W "-s --status -p --priority -P --project -l --label -n --limit -a --all --assignee --parent --roots --overdue --json" -- "$cur"))
50
- elif [[ "$prev" == "-s" || "$prev" == "--status" ]]; then
51
- COMPREPLY=($(compgen -W "open active done" -- "$cur"))
52
- elif [[ "$prev" == "-p" || "$prev" == "--priority" ]]; then
53
- COMPREPLY=($(compgen -W "0 1 2 3 4 p0 p1 p2 p3 p4 none urgent high medium low" -- "$cur"))
54
- fi
55
- ;;
56
- show|start|done|reopen|rm|remove)
57
- if [[ "$cur" == -* ]]; then
58
- COMPREPLY=($(compgen -W "--json" -- "$cur"))
59
- else
60
- COMPREPLY=($(compgen -W "$(_tk_task_ids)" -- "$cur"))
61
- fi
62
- ;;
63
- mv|move)
64
- if [[ "$cur" == -* ]]; then
65
- COMPREPLY=($(compgen -W "--json" -- "$cur"))
66
- else
67
- COMPREPLY=($(compgen -W "$(_tk_task_ids)" -- "$cur"))
68
- fi
69
- ;;
70
- edit)
71
- if [[ "$cur" == -* ]]; then
72
- COMPREPLY=($(compgen -W "-t --title -d --description -p --priority -l --labels -A --assignees --parent --estimate --due --json" -- "$cur"))
73
- elif [[ "$prev" == "-p" || "$prev" == "--priority" ]]; then
74
- COMPREPLY=($(compgen -W "0 1 2 3 4 p0 p1 p2 p3 p4 none urgent high medium low" -- "$cur"))
75
- else
76
- COMPREPLY=($(compgen -W "$(_tk_task_ids)" -- "$cur"))
77
- fi
78
- ;;
79
- log)
80
- if [[ "$cur" == -* ]]; then
81
- COMPREPLY=($(compgen -W "--json" -- "$cur"))
82
- else
83
- COMPREPLY=($(compgen -W "$(_tk_task_ids)" -- "$cur"))
84
- fi
85
- ;;
86
- block|unblock)
87
- if [[ "$cur" == -* ]]; then
88
- COMPREPLY=($(compgen -W "--json" -- "$cur"))
89
- else
90
- COMPREPLY=($(compgen -W "$(_tk_task_ids)" -- "$cur"))
91
- fi
92
- ;;
93
- clean)
94
- if [[ "$cur" == -* ]]; then
95
- COMPREPLY=($(compgen -W "--older-than -f --force --json" -- "$cur"))
96
- fi
97
- ;;
98
- config)
99
- if [[ "$prev" == "config" ]]; then
100
- COMPREPLY=($(compgen -W "project" -- "$cur"))
101
- fi
102
- ;;
103
- init)
104
- if [[ "$cur" == -* ]]; then
105
- COMPREPLY=($(compgen -W "-P --project --json" -- "$cur"))
106
- fi
107
- ;;
108
- completions)
109
- COMPREPLY=($(compgen -W "bash zsh fish" -- "$cur"))
110
- ;;
111
- ready|help)
112
- if [[ "$cur" == -* ]]; then
113
- COMPREPLY=($(compgen -W "--json" -- "$cur"))
114
- fi
115
- ;;
116
- esac
117
- }
118
-
119
- complete -F _tk tk`;
120
-
121
- export const ZSH_COMPLETION = `#compdef tk
122
-
123
- _tk_task_ids() {
124
- local tasks_dir
125
- tasks_dir="$(git rev-parse --show-toplevel 2>/dev/null)/.tasks"
126
- if [[ -d "$tasks_dir" ]]; then
127
- compadd -- \${(f)"$(find "$tasks_dir" -maxdepth 1 -name '*.json' ! -name 'config.json' -exec basename {} .json \\; 2>/dev/null)"}
128
- fi
129
- }
130
-
131
- _tk() {
132
- local -a commands
133
- commands=(
134
- 'init:Initialize .tasks/ directory'
135
- 'add:Create task'
136
- 'ls:List tasks'
137
- 'list:List tasks'
138
- 'ready:List ready tasks (active/open + unblocked)'
139
- 'show:Show task details'
140
- 'start:Start working on task'
141
- 'done:Complete task'
142
- 'reopen:Reopen task'
143
- 'edit:Edit task'
144
- 'log:Add log entry'
145
- 'block:Add blocker'
146
- 'unblock:Remove blocker'
147
- 'mv:Move task to different project'
148
- 'move:Move task to different project'
149
- 'rm:Delete task'
150
- 'remove:Delete task'
151
- 'clean:Remove old done tasks'
152
- 'check:Check task integrity'
153
- 'config:Show/set configuration'
154
- 'completions:Output shell completions'
155
- 'help:Show help'
156
- )
157
-
158
- local -a global_opts
159
- global_opts=(
160
- '--json[Output as JSON]'
161
- '(-h --help)'{-h,--help}'[Show help]'
162
- '(-V --version)'{-V,--version}'[Show version]'
163
- )
164
-
165
- local -a statuses
166
- statuses=('open' 'active' 'done')
167
-
168
- local -a priorities
169
- priorities=('0' '1' '2' '3' '4' 'p0' 'p1' 'p2' 'p3' 'p4' 'none' 'urgent' 'high' 'medium' 'low')
170
-
171
- local -a shells
172
- shells=('bash' 'zsh' 'fish')
173
-
174
- _arguments -C \
175
- $global_opts \
176
- '1:command:->command' \
177
- '*::arg:->args'
178
-
179
- case $state in
180
- command)
181
- _describe -t commands 'tk command' commands
182
- ;;
183
- args)
184
- case $words[1] in
185
- add)
186
- _arguments \
187
- '(-p --priority)'{-p,--priority}'[Priority]:priority:($priorities)' \
188
- '(-P --project)'{-P,--project}'[Project]:project:' \
189
- '(-d --description)'{-d,--description}'[Description]:description:' \
190
- '(-l --labels)'{-l,--labels}'[Labels]:labels:' \
191
- '(-A --assignees)'{-A,--assignees}'[Assignees]:assignees:' \
192
- '--parent[Parent task]:parent:_tk_task_ids' \
193
- '--estimate[Estimate]:estimate:' \
194
- '--due[Due date]:due:' \
195
- '--json[Output as JSON]' \
196
- '*:title:'
197
- ;;
198
- ls|list)
199
- _arguments \
200
- '(-s --status)'{-s,--status}'[Status]:status:($statuses)' \
201
- '(-p --priority)'{-p,--priority}'[Priority]:priority:($priorities)' \
202
- '(-P --project)'{-P,--project}'[Project]:project:' \
203
- '(-l --label)'{-l,--label}'[Label]:label:' \
204
- '--assignee[Assignee]:assignee:' \
205
- '--parent[Parent]:parent:_tk_task_ids' \
206
- '--roots[Root tasks only]' \
207
- '--overdue[Overdue only]' \
208
- '(-n --limit)'{-n,--limit}'[Limit]:limit:' \
209
- '(-a --all)'{-a,--all}'[Show all]' \
210
- '--json[Output as JSON]'
211
- ;;
212
- show|start|done|reopen|rm|remove)
213
- _arguments \
214
- '--json[Output as JSON]' \
215
- '1:task id:_tk_task_ids'
216
- ;;
217
- mv|move)
218
- _arguments \
219
- '--json[Output as JSON]' \
220
- '1:task id:_tk_task_ids' \
221
- '2:project:'
222
- ;;
223
- edit)
224
- _arguments \
225
- '(-t --title)'{-t,--title}'[Title]:title:' \
226
- '(-d --description)'{-d,--description}'[Description]:description:' \
227
- '(-p --priority)'{-p,--priority}'[Priority]:priority:($priorities)' \
228
- '(-l --labels)'{-l,--labels}'[Labels]:labels:' \
229
- '(-A --assignees)'{-A,--assignees}'[Assignees]:assignees:' \
230
- '--parent[Parent task]:parent:' \
231
- '--estimate[Estimate]:estimate:' \
232
- '--due[Due date]:due:' \
233
- '--json[Output as JSON]' \
234
- '1:task id:_tk_task_ids'
235
- ;;
236
- log)
237
- _arguments \
238
- '--json[Output as JSON]' \
239
- '1:task id:_tk_task_ids' \
240
- '*:message:'
241
- ;;
242
- block|unblock)
243
- _arguments \
244
- '--json[Output as JSON]' \
245
- '1:task id:_tk_task_ids' \
246
- '2:blocker id:_tk_task_ids'
247
- ;;
248
- clean)
249
- _arguments \
250
- '--older-than[Days]:days:' \
251
- '(-f --force)'{-f,--force}'[Force clean even if disabled]' \
252
- '--json[Output as JSON]'
253
- ;;
254
- check)
255
- _arguments \
256
- '--json[Output as JSON]'
257
- ;;
258
- config)
259
- _arguments \
260
- '1:subcommand:(project)'
261
- ;;
262
- init)
263
- _arguments \
264
- '(-P --project)'{-P,--project}'[Project]:project:' \
265
- '--json[Output as JSON]'
266
- ;;
267
- completions)
268
- _arguments \
269
- '1:shell:($shells)'
270
- ;;
271
- ready|help)
272
- _arguments \\
273
- '--json[Output as JSON]'
274
- ;;
275
- esac
276
- ;;
277
- esac
278
- }
279
-
280
- _tk "$@"`;
281
-
282
- export const FISH_COMPLETION = `# fish completion for tk
283
-
284
- function __tk_task_ids
285
- set -l tasks_dir (git rev-parse --show-toplevel 2>/dev/null)/.tasks
286
- if test -d "$tasks_dir"
287
- for f in $tasks_dir/*.json
288
- set -l name (basename $f .json)
289
- if test "$name" != "config"
290
- echo $name
291
- end
292
- end
293
- end
294
- end
295
-
296
- function __tk_needs_command
297
- set -l cmd (commandline -opc)
298
- if test (count $cmd) -eq 1
299
- return 0
300
- end
301
- for i in $cmd[2..-1]
302
- switch $i
303
- case '-*'
304
- continue
305
- case '*'
306
- return 1
307
- end
308
- end
309
- return 0
310
- end
311
-
312
- function __tk_using_command
313
- set -l cmd (commandline -opc)
314
- for i in $cmd[2..-1]
315
- switch $i
316
- case '-*'
317
- continue
318
- case '*'
319
- if test "$i" = "$argv[1]"
320
- return 0
321
- end
322
- return 1
323
- end
324
- end
325
- return 1
326
- end
327
-
328
- # Global options
329
- complete -c tk -n __tk_needs_command -l json -d 'Output as JSON'
330
- complete -c tk -n __tk_needs_command -s h -l help -d 'Show help'
331
- complete -c tk -n __tk_needs_command -s V -l version -d 'Show version'
332
-
333
- # Commands
334
- complete -c tk -n __tk_needs_command -f -a init -d 'Initialize .tasks/ directory'
335
- complete -c tk -n __tk_needs_command -f -a add -d 'Create task'
336
- complete -c tk -n __tk_needs_command -f -a ls -d 'List tasks'
337
- complete -c tk -n __tk_needs_command -f -a list -d 'List tasks'
338
- complete -c tk -n __tk_needs_command -f -a ready -d 'List ready tasks (active/open + unblocked)'
339
- complete -c tk -n __tk_needs_command -f -a show -d 'Show task details'
340
- complete -c tk -n __tk_needs_command -f -a start -d 'Start working on task'
341
- complete -c tk -n __tk_needs_command -f -a done -d 'Complete task'
342
- complete -c tk -n __tk_needs_command -f -a reopen -d 'Reopen task'
343
- complete -c tk -n __tk_needs_command -f -a edit -d 'Edit task'
344
- complete -c tk -n __tk_needs_command -f -a log -d 'Add log entry'
345
- complete -c tk -n __tk_needs_command -f -a block -d 'Add blocker'
346
- complete -c tk -n __tk_needs_command -f -a unblock -d 'Remove blocker'
347
- complete -c tk -n __tk_needs_command -f -a mv -d 'Move task to different project'
348
- complete -c tk -n __tk_needs_command -f -a move -d 'Move task to different project'
349
- complete -c tk -n __tk_needs_command -f -a rm -d 'Delete task'
350
- complete -c tk -n __tk_needs_command -f -a remove -d 'Delete task'
351
- complete -c tk -n __tk_needs_command -f -a clean -d 'Remove old done tasks'
352
- complete -c tk -n __tk_needs_command -f -a check -d 'Check task integrity'
353
- complete -c tk -n __tk_needs_command -f -a config -d 'Show/set configuration'
354
- complete -c tk -n __tk_needs_command -f -a completions -d 'Output shell completions'
355
- complete -c tk -n __tk_needs_command -f -a help -d 'Show help'
356
-
357
- # add command options
358
- complete -c tk -n '__tk_using_command add' -s p -l priority -d 'Priority' -xa '0 1 2 3 4 p0 p1 p2 p3 p4 none urgent high medium low'
359
- complete -c tk -n '__tk_using_command add' -s P -l project -d 'Project'
360
- complete -c tk -n '__tk_using_command add' -s d -l description -d 'Description'
361
- complete -c tk -n '__tk_using_command add' -s l -l labels -d 'Labels'
362
- complete -c tk -n '__tk_using_command add' -s A -l assignees -d 'Assignees'
363
- complete -c tk -n '__tk_using_command add' -l parent -d 'Parent task'
364
- complete -c tk -n '__tk_using_command add' -l estimate -d 'Estimate'
365
- complete -c tk -n '__tk_using_command add' -l due -d 'Due date'
366
- complete -c tk -n '__tk_using_command add' -l json -d 'Output as JSON'
367
-
368
- # ls/list command options
369
- complete -c tk -n '__tk_using_command ls' -s s -l status -d 'Status' -xa 'open active done'
370
- complete -c tk -n '__tk_using_command list' -s s -l status -d 'Status' -xa 'open active done'
371
- complete -c tk -n '__tk_using_command ls' -s p -l priority -d 'Priority' -xa '0 1 2 3 4 p0 p1 p2 p3 p4 none urgent high medium low'
372
- complete -c tk -n '__tk_using_command list' -s p -l priority -d 'Priority' -xa '0 1 2 3 4 p0 p1 p2 p3 p4 none urgent high medium low'
373
- complete -c tk -n '__tk_using_command ls' -s P -l project -d 'Project'
374
- complete -c tk -n '__tk_using_command list' -s P -l project -d 'Project'
375
- complete -c tk -n '__tk_using_command ls' -s l -l label -d 'Label'
376
- complete -c tk -n '__tk_using_command list' -s l -l label -d 'Label'
377
- complete -c tk -n '__tk_using_command ls' -l assignee -d 'Assignee'
378
- complete -c tk -n '__tk_using_command list' -l assignee -d 'Assignee'
379
- complete -c tk -n '__tk_using_command ls' -l parent -d 'Parent'
380
- complete -c tk -n '__tk_using_command list' -l parent -d 'Parent'
381
- complete -c tk -n '__tk_using_command ls' -l roots -d 'Root tasks only'
382
- complete -c tk -n '__tk_using_command list' -l roots -d 'Root tasks only'
383
- complete -c tk -n '__tk_using_command ls' -l overdue -d 'Overdue only'
384
- complete -c tk -n '__tk_using_command list' -l overdue -d 'Overdue only'
385
- complete -c tk -n '__tk_using_command ls' -s n -l limit -d 'Limit'
386
- complete -c tk -n '__tk_using_command list' -s n -l limit -d 'Limit'
387
- complete -c tk -n '__tk_using_command ls' -s a -l all -d 'Show all'
388
- complete -c tk -n '__tk_using_command list' -s a -l all -d 'Show all'
389
- complete -c tk -n '__tk_using_command ls' -l json -d 'Output as JSON'
390
- complete -c tk -n '__tk_using_command list' -l json -d 'Output as JSON'
391
-
392
- # Commands that take task ID
393
- complete -c tk -n '__tk_using_command show' -f -a '(__tk_task_ids)' -d 'Task ID'
394
- complete -c tk -n '__tk_using_command start' -f -a '(__tk_task_ids)' -d 'Task ID'
395
- complete -c tk -n '__tk_using_command done' -f -a '(__tk_task_ids)' -d 'Task ID'
396
- complete -c tk -n '__tk_using_command reopen' -f -a '(__tk_task_ids)' -d 'Task ID'
397
- complete -c tk -n '__tk_using_command mv' -f -a '(__tk_task_ids)' -d 'Task ID'
398
- complete -c tk -n '__tk_using_command move' -f -a '(__tk_task_ids)' -d 'Task ID'
399
- complete -c tk -n '__tk_using_command rm' -f -a '(__tk_task_ids)' -d 'Task ID'
400
- complete -c tk -n '__tk_using_command remove' -f -a '(__tk_task_ids)' -d 'Task ID'
401
- complete -c tk -n '__tk_using_command log' -f -a '(__tk_task_ids)' -d 'Task ID'
402
-
403
- # edit command
404
- complete -c tk -n '__tk_using_command edit' -f -a '(__tk_task_ids)' -d 'Task ID'
405
- complete -c tk -n '__tk_using_command edit' -s t -l title -d 'Title'
406
- complete -c tk -n '__tk_using_command edit' -s d -l description -d 'Description'
407
- complete -c tk -n '__tk_using_command edit' -s p -l priority -d 'Priority' -xa '0 1 2 3 4 p0 p1 p2 p3 p4 none urgent high medium low'
408
- complete -c tk -n '__tk_using_command edit' -s l -l labels -d 'Labels'
409
- complete -c tk -n '__tk_using_command edit' -s A -l assignees -d 'Assignees'
410
- complete -c tk -n '__tk_using_command edit' -l parent -d 'Parent task'
411
- complete -c tk -n '__tk_using_command edit' -l estimate -d 'Estimate'
412
- complete -c tk -n '__tk_using_command edit' -l due -d 'Due date'
413
- complete -c tk -n '__tk_using_command edit' -l json -d 'Output as JSON'
414
-
415
- # block/unblock commands
416
- complete -c tk -n '__tk_using_command block' -f -a '(__tk_task_ids)' -d 'Task ID'
417
- complete -c tk -n '__tk_using_command block' -l json -d 'Output as JSON'
418
- complete -c tk -n '__tk_using_command unblock' -f -a '(__tk_task_ids)' -d 'Task ID'
419
- complete -c tk -n '__tk_using_command unblock' -l json -d 'Output as JSON'
420
-
421
- # log command
422
- complete -c tk -n '__tk_using_command log' -l json -d 'Output as JSON'
423
-
424
- # clean command
425
- complete -c tk -n '__tk_using_command clean' -l older-than -d 'Days threshold'
426
- complete -c tk -n '__tk_using_command clean' -s f -l force -d 'Force clean even if disabled'
427
- complete -c tk -n '__tk_using_command clean' -l json -d 'Output as JSON'
428
-
429
- # check command
430
- complete -c tk -n '__tk_using_command check' -l json -d 'Output as JSON'
431
-
432
- # config command
433
- complete -c tk -n '__tk_using_command config' -f -a 'project' -d 'Config option'
434
-
435
- # init command
436
- complete -c tk -n '__tk_using_command init' -s P -l project -d 'Project'
437
- complete -c tk -n '__tk_using_command init' -l json -d 'Output as JSON'
438
-
439
- # completions command
440
- complete -c tk -n '__tk_using_command completions' -f -a 'bash zsh fish' -d 'Shell'`;