Adds help to todo script

Jonathan Hodgson 4 years ago
parent b634044c16
commit a7ab6513bb
  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