[GRASS-SVN] r34307 - grass/branches/develbranch_6/scripts/r.mask

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 15 12:31:56 EST 2008


Author: marisn
Date: 2008-11-15 12:31:56 -0500 (Sat, 15 Nov 2008)
New Revision: 34307

Modified:
   grass/branches/develbranch_6/scripts/r.mask/r.mask
Log:
Don't require map name if removing existing MASK. Fixes #223

Modified: grass/branches/develbranch_6/scripts/r.mask/r.mask
===================================================================
--- grass/branches/develbranch_6/scripts/r.mask/r.mask	2008-11-15 16:41:31 UTC (rev 34306)
+++ grass/branches/develbranch_6/scripts/r.mask/r.mask	2008-11-15 17:31:56 UTC (rev 34307)
@@ -24,7 +24,7 @@
 #% type: string
 #% gisprompt: old,cell,raster
 #% description: Raster map to use as MASK
-#% required : yes
+#% required : no
 #%END
 #%option
 #% key: maskcats
@@ -82,7 +82,10 @@
  		g.message -w "No existing MASK to remove"
 	fi
 else
-
+	if [ ! $GIS_OPT_INPUT ]; then
+		g.message -w "No raster map for MASK provided"
+		exit 1;
+	fi
 	if [ "$GIS_FLAG_O" -eq 1 ]; then
 		echo "$GIS_OPT_MASKCATS = 1" | r.reclass input=$GIS_OPT_INPUT output=MASK --o
 	else 
@@ -108,3 +111,5 @@
         g.message "Removing or renaming raster file named MASK will"
         g.message "restore raster operations to normal"
 fi
+
+exit 0;



More information about the grass-commit mailing list