[GRASS-SVN] r73996 - grass/trunk/testsuite/examples

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 22 01:11:26 PST 2019


Author: neteler
Date: 2019-01-22 01:11:26 -0800 (Tue, 22 Jan 2019)
New Revision: 73996

Modified:
   grass/trunk/testsuite/examples/test_framework_GRASS_GIS_with_NC.sh
Log:
test_framework_GRASS_GIS_with_NC.sh: make conf_file a parameter, add help text

Modified: grass/trunk/testsuite/examples/test_framework_GRASS_GIS_with_NC.sh
===================================================================
--- grass/trunk/testsuite/examples/test_framework_GRASS_GIS_with_NC.sh	2019-01-22 02:51:33 UTC (rev 73995)
+++ grass/trunk/testsuite/examples/test_framework_GRASS_GIS_with_NC.sh	2019-01-22 09:11:26 UTC (rev 73996)
@@ -26,10 +26,41 @@
 #
 ############################################################################
 
-### CONFIGURATION
+### Fetch CONFIGURATION
 
-source test_framework_GRASS_GIS_with_NC.conf
+CONF="test_framework_GRASS_GIS_with_NC.conf"
 
+usage_msg(){
+echo "Usage:
+  $0 [conf_file]
+
+Example:
+  $0 ${CONF}
+"
+}
+
+if [ ! -z "$1" ] ; then
+   case "$1" in
+      -h | --h | -help | --help)
+         usage_msg
+         exit 0
+         ;;
+      *)
+         if [ -f ${1} ] ; then
+            CONF="$1"
+         else
+            echo "ERROR: $1 is not a file"
+            exit 1
+         fi
+         ;;
+    esac
+else
+    usage_msg
+    exit 0
+fi
+
+source ${CONF}
+
 ######### nothing to change below
 
 set -e  # fail fast



More information about the grass-commit mailing list