File tree 2 files changed +16
-5
lines changed
2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,12 @@ tusker show
43
43
2 ❌ Fill rems 25 April 2018 11:53:25
44
44
```
45
45
46
+ - Delete multiple tasks from the list
47
+ ```
48
+ tusker del 1 3
49
+ tusker show
50
+ 1 ❌ Collect NOC certificate 25 April 2018 11:53:23
51
+ ```
46
52
### What's the difference between ` check ` and ` del ` ?
47
53
Use ` del ` if you'd * never* like to look back at a completed task.
48
54
Use ` check ` if you want the satisfaction of seeing the ✓ beside your completed task for a while.
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ check_args() {
20
20
return
21
21
fi
22
22
23
- if [ $# -gt 1 ] && [ " $1 " = " add" ]; then
23
+ if [ $# -gt 1 ] && ( [ " $1 " = " add" ] || [ " $1 " = " del " ]) ; then
24
24
return
25
25
fi
26
26
@@ -46,8 +46,12 @@ add_task() {
46
46
}
47
47
48
48
delete_task () {
49
- task_id=$1
50
- sed -i -e " $task_id " " d" " $FILE_NAME "
49
+ format_str=" "
50
+ for task_id in " $@ "
51
+ do
52
+ format_str=" $task_id " " d;" " $format_str "
53
+ done
54
+ sed -i -e " $format_str " " $FILE_NAME "
51
55
}
52
56
53
57
check_task () {
@@ -86,8 +90,9 @@ main() {
86
90
;;
87
91
88
92
del)
89
- delete_task " $2 "
90
- printf " Task deleted\n"
93
+ shift
94
+ delete_task " $@ "
95
+ printf " Task(s) deleted\n"
91
96
;;
92
97
93
98
check)
You can’t perform that action at this time.
0 commit comments