From a7ab6513bbdc4bae383f80d61744e6b99b66e988 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Fri, 24 Apr 2020 11:33:54 +0100 Subject: [PATCH] Adds help to todo script --- bin/.bin/todo | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bin/.bin/todo b/bin/.bin/todo index 5e028b24..b92c05a5 100755 --- a/bin/.bin/todo +++ b/bin/.bin/todo @@ -8,6 +8,18 @@ function is_int() { return $(test "$@" -eq "$@" > /dev/null 2>&1); } +function help(){ + echo "TODO" + echo "====" + echo "Simple todo list manager" + echo "" + ( + echo "list|l List contents of to do list" + echo "add|a \"Description\" Add an item to the todo list" + echo "delete|del|d \"item id\" Delete an item from the todo list" + ) | column -t -s' ' + +} function list(){ if [ -f "$FILE" ]; then awk '{printf("%5d : %s\n", NR,$0)}' "$FILE" @@ -49,6 +61,10 @@ if [ -n "$1" ]; then delete "$@" exit 0 ;; + "help"|"--help"|"-h") + help + exit 0 + ;; *) echo "Command $1 unknown" exit 1