commit: b7614a805a6ef25eb82019d6244b73b8e770b705
parent: a2df2088e4492a9ce23481dda43b334a77f3bbb7
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 8 Jan 2019 05:55:08 +0100
bin/timey-whyme.sh: Use cut(1) to strip out #comments instead of grep ^#
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/bin/timey-whyme.sh b/bin/timey-whyme.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright CC-BY-SA-4.0 2017- Haelwenn (lanodan) Monnier <contact@hacktivis.me>
+# Copyright CC-BY-SA-4.0 2017-2019 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
xdd="${XDG_DATA_DIR:-$HOME/.local/share}/timey-whyme"
today="$(date --date=now +%Y-%m-%d)"
@@ -16,18 +16,18 @@ verify_xxd() {
todo() {
verify_xxd todo.csv
- echo ",0,###[1;32m, To Do, ###[0m
+ echo ",0,###[1;32m To Do, , ###[0m
${today},[1;34m###, Now +7 days, ###
-${later},[0m###, Later,###[1m
-$(grep -av '^#' "$xdd/todo.csv")[0m" | sort -n | $form
+${later},[0m###, Later,###
+$(cut -d '#' -f -1 "$xdd/todo.csv" | grep -v '^$')[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 -av '^#' "$xdd/calendar.csv")[0m" | sort -n | $form
+${later},[0m###, Later,###
+$(cut -d '#' -f -1 "$xdd/calendar.csv" | grep -v '^$')[0m" | sort -n | $form
}
case "$1" in