Adds help to todo script

master
Jonathan Hodgson 5 years ago
parent 1b0584a8f6
commit 428a21b7a1
  1. 16
      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

Loading…
Cancel
Save