commit: bf783d05f6f7c33d50efdc375e134d934a46c936
parent: aab5a31a14a2245622b2d567dc96c591ae50b393
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 10 May 2017 17:01:01 +0200
bin/timey-whyme.sh: Fix sort’ing, usage, todo heading syntax
Diffstat:
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/bin/timey-whyme.sh b/bin/timey-whyme.sh
@@ -9,27 +9,27 @@ highlight='[1;34m%s[0m'
form='column -s, -o -t'
usage() {
- printf "Usage: [[all|both|cal|todo] [date]]\n"
+ printf "Usage: [[all|both|cal|todo]\n"
}
-#todo() {
-# printf $heading 'To Do List'
-# printf $highlight $(grep "^$today" $xdd/todo.csv | $form)
-# grep -E -v "^(#|$today)" $xdd/todo.csv | $form
-#}
+verify_xxd() {
+ [ -e ${xdd}/$1 ] || echo "Please create a file a the following, see examples for help: ${xdd}/${1}"
+}
todo() {
- echo "0000-00-00,###[1;32m, To Do, ###[0m
+ verify_xxd todo.csv
+ echo ",0,###[1;32m, To Do, ###[0m
${today},[1;34m###, Now +7 days, ###
${later},[0m###, Later,###[1m
-$(grep -v '^#' $xdd/calendar.csv)[0m" | sort | $form
+$(grep -v '^#' $xdd/todo.csv)[0m" | sort -n | $form
}
calendar() {
+ verify_xxd calendar.csv
echo "0000-00-00,###[1;32m, Calendar, ###[0m
${today},[1;34m###, Now +7 days, ###
${later},[0m###, Later,###[1m
-$(grep -v '^#' $xdd/calendar.csv)[0m" | sort | $form
+$(grep -v '^#' $xdd/calendar.csv)[0m" | sort -n | $form
}
case "$1" in