소스 검색

r.distance: bugfix https://trac.osgeo.org/grass/ticket/1731

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53188 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 년 전
부모
커밋
adb604d2d3
2개의 변경된 파일9개의 추가작업 그리고 20개의 파일을 삭제
  1. 5 5
      raster/r.distance/main.c
  2. 4 15
      raster/r.distance/parse.c

+ 5 - 5
raster/r.distance/main.c

@@ -8,11 +8,11 @@
  * PURPOSE:      Locates the closest points between objects in two 
  *               raster maps.
  *
- * COPYRIGHT:    (C) 2003 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2003, 2012 by the GRASS Development Team
  *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
+ *               This program is free software under the GNU General
+ *               Public License (>=v2). Read the file COPYING that
+ *               comes with GRASS for details.
  *
  ***************************************************************************/
 
@@ -51,5 +51,5 @@ int main(int argc, char *argv[])
 
     report(&parms);
 
-    return 0;
+    exit(EXIT_SUCCESS);
 }

+ 4 - 15
raster/r.distance/parse.c

@@ -28,23 +28,12 @@ void parse(int argc, char *argv[], struct Parms *parms)
     struct Flag *labels, *overlap;
     const char *name, *mapset;
 
-    maps = G_define_option();
+    maps = G_define_standard_option(G_OPT_R_MAPS);
+    maps->key_desc = "name1,name2";
+    maps->description = _("Name of two input raster maps for computing inter-class distances");
 
-    maps->key = "maps";
-    maps->key_desc = "map1,map2";
-    maps->required = YES;
-    maps->multiple = NO;
-    maps->type = TYPE_STRING;
-    maps->description = _("Maps for computing inter-class distances");
-    maps->gisprompt = "old,cell,raster";
-
-    fs = G_define_option();
-    fs->key = "fs";
-    fs->required = NO;
-    fs->multiple = NO;
+    fs = G_define_standard_option(G_OPT_F_SEP);
     fs->answer = ":";		/* colon is default output fs */
-    fs->type = TYPE_STRING;
-    fs->description = _("Output field separator");
 
     labels = G_define_flag();
     labels->key = 'l';