From 44d7def8d44ff4de81c15de1695ae626d6e129aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Sat, 29 Oct 2022 14:23:42 +0200 Subject: [PATCH] Add help command. --- isidore.sh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/isidore.sh b/isidore.sh index 93d2e89..3b1e23c 100755 --- a/isidore.sh +++ b/isidore.sh @@ -23,6 +23,8 @@ ISIDORE_CONFIG_DIR_OPTIONS=( "$HOME/.isidore") ISIDORE_AUTHOR_NAME="" +PROG_NAME=$0 + ## # Create the configuration file. This function is called if it does not already # exist. @@ -76,7 +78,23 @@ function set_config_vars() ## function print_usage() { - echo "USAGE: $1 [options]" + echo "USAGE: $PROG_NAME [options]" +} + +function print_help() +{ + print_usage + echo -e "\nCOMMANDS: + new + Create a new Isidore project + build + Build the project rooted in the current directory + clean + Clean the built files + version + Print the current version + help + Show this help information" } ## @@ -133,7 +151,9 @@ case $1 in new_project $2 $3;; clean) clean_project;; + help) + print_help;; *) echo "Unknown command $1. Use the 'help' command." - print_usage $0;; + print_usage;; esac