-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrlsa
executable file
·49 lines (38 loc) · 1.16 KB
/
rlsa
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
#!/bin/sh
#
# Like 'lsa', only it lists items in *all* files in your TODO_DIR
# So, 'rlsa' = "Really List All"
#
# Author: Jon Smajda
# License: GPL, http://www.gnu.org/copyleft/gpl.html
# URL: http://github.com/smajda/todo.actions.d
############# config:
## 1. list the files you want to show
#mytodos=(todo nxt smd buy stuff)
## OR
## 2. or figure them out manually
cd "$TODO_DIR"
listtodos=`find . -maxdepth 1 -type f | sed 's/\.\///g' | grep -Ev "^\.|\.cfg$|\.bak$|\.tmp$|^report|^done"`
# ^^ add exceptions up there
mytodos=($listtodos);
########################
action=$1
shift
# what to display in todo.sh -h, appended to very end
[ "$action" = "usage" ] && {
echo " `basename $0` [TERM...]"
echo " 'Really List All' - just like 'lsa' only it lists tasks"
echo " from any file in your TODO_DIR."
echo " (Specify exceptions in the 'listtodos' variable)"
echo " in $0"
echo ""
exit
}
# loop through files in $mytodos
# append file name to task, append to $TMP_FILE
# and then list
for ((i=0; i<${#mytodos[@]}; i++))
do
cat "$TODO_DIR"/${mytodos[$i]} | sed "s/^/${mytodos[$i]}\ /g" >> "$TMP_FILE"
done
_list "$TMP_FILE" "$@"