Commit 5733bc9e authored by Richard Torenvliet's avatar Richard Torenvliet

rename and corrected help

parent ec1c0da8
...@@ -114,25 +114,23 @@ function create_directory() { ...@@ -114,25 +114,23 @@ function create_directory() {
#Help function #Help function
function HELP { function HELP {
echo -e \\n"Help documentation for ${BOLD}${SCRIPT}.${NORM}"\\n echo -e \\n"Help documentation for ${SCRIPT}."\\n
echo -e "${REV}Basic usage:${NORM} ${BOLD}$SCRIPT file.ext${NORM}"\\n echo -e "Basic usage: $SCRIPT gradebook.zip"\\n
echo "Command line switches are optional. The following switches are recognized." echo "Command line switches are optional. The following switches are recognized."
echo "${REV}-d${NORM} --Set output directory ${BOLD}a${NORM}. Default\n\ echo "-d --Set output directory. ${BOLD}$OUTPUT_DIR${NORM}."
is ${BOLD}/tmp/blackboard${NORM}." echo -e "-h --Displays this help message. No further functions are performed."\\n
echo -e "${REV}-h${NORM} --Displays this help message. No further functions are performed."\\n echo -e "Example: ${BOLD}$SCRIPT -d assignment1 gradebook.zip${NORM}"\\n
echo -e "Example: ${BOLD}$SCRIPT -d /tmp/assignment1 gradebook.zip${NORM}"\\n
exit 1 exit 1
} }
#Check the number of arguments. If none are passed, print help and exit. #Check the number of arguments. If none are passed, print help and exit.
NUMARGS=$# NUMARGS=$#
echo -e \\n"Number of arguments: $NUMARGS"
if [ $NUMARGS -eq 0 ]; then if [ $NUMARGS -eq 0 ]; then
HELP HELP
fi fi
while getopts :d:h: FLAG; do while getopts :d:h FLAG; do
case $FLAG in case $FLAG in
d) d)
OUTPUT_DIR=$OPTARG OUTPUT_DIR=$OPTARG
...@@ -140,7 +138,7 @@ while getopts :d:h: FLAG; do ...@@ -140,7 +138,7 @@ while getopts :d:h: FLAG; do
h) #show help h) #show help
HELP HELP
;; ;;
\?) #unrecognized option - show help \?)
echo -e \\n"Option -${BOLD}$OPTARG${NORM} not allowed." echo -e \\n"Option -${BOLD}$OPTARG${NORM} not allowed."
HELP HELP
;; ;;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment