logo

utils

~/.local/bin tools and git-hooks
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:

Mbin/timey-whyme.sh18+++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/bin/timey-whyme.sh b/bin/timey-whyme.sh @@ -9,27 +9,27 @@ highlight='%s' 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,###, To Do, ### + verify_xxd todo.csv + echo ",0,###, To Do, ### ${today},###, Now +7 days, ### ${later},###, Later,### -$(grep -v '^#' $xdd/calendar.csv)" | sort | $form +$(grep -v '^#' $xdd/todo.csv)" | sort -n | $form } calendar() { + verify_xxd calendar.csv echo "0000-00-00,###, Calendar, ### ${today},###, Now +7 days, ### ${later},###, Later,### -$(grep -v '^#' $xdd/calendar.csv)" | sort | $form +$(grep -v '^#' $xdd/calendar.csv)" | sort -n | $form } case "$1" in