diff --git a/sit b/sit index a47b7fd..e6c203e 100755 --- a/sit +++ b/sit @@ -29,18 +29,44 @@ function usage() { echo " copy_logs" echo " setperms" echo " all" - exit 0 } # sit class file to be installed -sit_classfile=$1 +sit_classfile="" # sit action to be performed -sit_action=$2 -if [[ -n $sit_action ]] ; then - echo "Performing action: $sit_action" -else - sit_action="all" -fi +sit_action="all" + +while [ $1 != "" ] ; do + case $1 in + "sitinfo") + sit_sitinfo + exit 0 + ;; + "all"| \ + "unpack"| \ + "prepare"| \ + "configure"| \ + "build"| \ + "pretest"| \ + "install"| \ + "posttest"| \ + "postinst"| \ + "copy_logs"| \ + "setperms") + sit_action=$1 + ;; + "-*h"|"--help"|"help"|"usage") + usage $@ + exit 0 + ;; + *) + sit_classfile=$1 + ;; + esac + shift +done +echo "Actions to perform: $sit_action" +echo "Sit class file(s): $sit_classfile" # Reading in user configuration file if it exists if [[ -e $SIT_USER_CONFIG_FILE ]] ; then