瀏覽代碼

test_framework_GRASS_GIS_with_NC.sh: make conf_file a parameter, add help text

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73996 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 6 年之前
父節點
當前提交
6d74fa61c1
共有 1 個文件被更改,包括 33 次插入2 次删除
  1. 33 2
      testsuite/examples/test_framework_GRASS_GIS_with_NC.sh

+ 33 - 2
testsuite/examples/test_framework_GRASS_GIS_with_NC.sh

@@ -26,9 +26,40 @@
 #
 ############################################################################
 
-### CONFIGURATION
+### Fetch CONFIGURATION
+
+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 test_framework_GRASS_GIS_with_NC.conf
+source ${CONF}
 
 ######### nothing to change below