From ac4d188dfad2c5688c3bfb7666c3d2467bd6de7c Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Mon, 2 May 2016 08:55:19 +0000 Subject: [PATCH] Display usage information in case of unknown action. --- sit | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sit b/sit index 0a0860b..d72a5a2 100755 --- a/sit +++ b/sit @@ -14,6 +14,24 @@ SIT_PATH=$(cd $(dirname $PWD/$0); pwd) SIT_CONFIG_FILE=$SIT_PATH/etc/sit.conf SIT_USER_CONFIG_FILE=$HOME/.sit +function usage() { + echo "Usage: $0 [action] " + echo "Valid actions:" + echo " sit_sitinfo" + echo " unpack" + echo " prepare" + echo " configure" + echo " build" + echo " pretest" + echo " install" + echo " posttest" + echo " postinst" + echo " copy_logs" + echo " setperms" + echo " all" + exit 0 +} + # sit action to be performed sit_action=$2 if [[ -n $sit_action ]] ; then @@ -263,6 +281,7 @@ case $sit_action in ;; *) echo "Unknown action $sit_action" + usage esac