From 90a0fe61d3947105e02acfea602d662c3c5a6885 Mon Sep 17 00:00:00 2001 From: Ivan Reshetnikov Date: Thu, 16 Feb 2023 23:43:26 +0500 Subject: [PATCH] Add "help" command (#3) --- histd.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/histd.sh b/histd.sh index 26f6645..8386653 100755 --- a/histd.sh +++ b/histd.sh @@ -42,6 +42,16 @@ function merge { find $BASE_DIR -type f -name "*.md" -exec echo "# {}" \; -exec cat "{}" \; -exec echo \; } +function help { + echo "Histd - How I Spent This Day" + echo "A simple personal diary app" + echo + echo "Usage:" + echo "- histd.sh - open a text editor to describe the current day" + echo "- histd.sh backup - create an archive of all notes" + echo "- histd.sh merge - print all notes" + echo "- histd.sh help - show this message" +} # Prepare the environment BASE_DIR=~/.local/share/histd @@ -54,6 +64,10 @@ elif [[ $1 == "backup" ]]; then backup elif [[ $1 == "merge" ]]; then merge +elif [[ $1 == "help" ]]; then + help else echo Command not found + echo + help fi