-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathtaskban
More file actions
executable file
·79 lines (73 loc) · 1.94 KB
/
taskban
File metadata and controls
executable file
·79 lines (73 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# This is a wrapper script for taskwarrior and taskopen for kanban-style actions.
# Taskwarrior prerequisites/UDA config:
# uda.state.type=string
# uda.state.label=State
# uda.state.values=wip,rdy,blg,done
# uda.state.default=rdy
# Taskopen prerequiites:
# - define a delete action (see examples/default)
# - define an archive action (see scripts/archive)
DEFAULT_REPORT=()
SUPPRESS_OUT="rc.verbose=nothing"
if [ $# -lt 1 ]; then
echo "Usage: $0 (add|backlog|delete|archive|proceed|retreat|open|yield|unlink) [<id>|<filter>]"
echo " or: $0 (sched|link) <id> (<date>|<annotation>)"
task ${DEFAULT_REPORT[@]}
exit 1
fi
case "$1" in
ad|add)
task add ${@:2}
task ${DEFAULT_REPORT[@]}
;;
ar|arc|arch|archi|archiv|archive)
taskopen archive ${@:2}
task done ${@:2}
task ${DEFAULT_REPORT[@]}
;;
b|ba|bac|back|backl|backlo|backlog)
task add state:blg ${@:2}
task ${DEFAULT_REPORT[@]}
;;
d|de|del|dele|delet|delete)
task del ${@:2}
task ${DEFAULT_REPORT[@]}
;;
p|pr|pro|proc|proce|procee|proceed)
task ${SUPPRESS_OUT} ${@:2} state:wip mod state:done
task ${SUPPRESS_OUT} ${@:2} state:rdy mod state:wip
task ${SUPPRESS_OUT} ${@:2} state:blg mod state:rdy
task ${DEFAULT_REPORT[@]}
;;
r|re|ret|retr|retre|retrea|retreat)
task ${SUPPRESS_OUT} ${@:2} state:rdy mod state:blg
task ${SUPPRESS_OUT} ${@:2} state:wip mod state:rdy
task ${SUPPRESS_OUT} ${@:2} state:done mod state:wip
task ${DEFAULT_REPORT[@]}
;;
s|sc|sch|sche|sched)
# schedule to value of last argument
task ${@:2:$(($#-2))} mod sched:${@:$#}
task ${DEFAULT_REPORT[@]}
;;
y|yi|yie|yiel|yield)
# unschedule
task ${@:2} mod sched:
task ${DEFAULT_REPORT[@]}
;;
o|op|ope|open)
taskopen ${@:2}
;;
l|li|lin|link)
# annotate with value of last argument
task ${@:2:$(($#-2))} annotate -- ${@:$#}
;;
u|un|unl|unli|unlin|unlink)
taskopen delete ${@:2}
;;
*)
# default: pass everything to taskopen
taskopen $*
;;
esac