[GRASS-SVN] r31826 - grass/branches/develbranch_6/imagery/i.smap/shapiro

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 23 09:21:50 EDT 2008


Author: neteler
Date: 2008-06-23 09:21:50 -0400 (Mon, 23 Jun 2008)
New Revision: 31826

Modified:
   grass/branches/develbranch_6/imagery/i.smap/shapiro/main.c
   grass/branches/develbranch_6/imagery/i.smap/shapiro/parse.c
Log:
exit codes; parser simplification (merge from trunk)

Modified: grass/branches/develbranch_6/imagery/i.smap/shapiro/main.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.smap/shapiro/main.c	2008-06-23 13:21:26 UTC (rev 31825)
+++ grass/branches/develbranch_6/imagery/i.smap/shapiro/main.c	2008-06-23 13:21:50 UTC (rev 31826)
@@ -47,8 +47,6 @@
     segment (&S, &parms, &files);
 
     closefiles(&parms, &files);
-    exit(0);
+    exit(EXIT_SUCCESS);
 }
 
-
-

Modified: grass/branches/develbranch_6/imagery/i.smap/shapiro/parse.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.smap/shapiro/parse.c	2008-06-23 13:21:26 UTC (rev 31825)
+++ grass/branches/develbranch_6/imagery/i.smap/shapiro/parse.c	2008-06-23 13:21:50 UTC (rev 31826)
@@ -12,38 +12,25 @@
     struct Flag *quiet;
     struct Flag *ml;
 
-    group = G_define_option();
-    group->key = "group";
-    group->description = _("imagery group");
-    group->required = YES;
-    group->type = TYPE_STRING;
-    group->gisprompt = "old,group,group";
+    group = G_define_standard_option(G_OPT_I_GROUP);
 
-    subgroup = G_define_option();
-    subgroup->key = "subgroup";
-    subgroup->description = _("imagery subgroup");
-    subgroup->required = YES;
-    subgroup->type = TYPE_STRING;
+    subgroup = G_define_standard_option(G_OPT_I_SUBGROUP);
 
     sigfile = G_define_option();
     sigfile->key = "signaturefile";
-    sigfile->description = _("imagery signaturefile");
+    sigfile->description = _("Name of imagery signaturefile");
+    sigfile->key_desc     = "name";
     sigfile->required = YES;
     sigfile->type = TYPE_STRING;
 
     blocksize = G_define_option();
     blocksize->key = "blocksize";
-    blocksize->description = _("size of submatrix to process at one time");
+    blocksize->description = _("Size of submatrix to process at one time");
     blocksize->required = NO;
     blocksize->type = TYPE_INTEGER;
     blocksize->answer = "128";
 
-    output = G_define_option();
-    output->key = "output";
-    output->description = _("output raster map");
-    output->required = YES;
-    output->type = TYPE_STRING;
-    output->gisprompt = "new,cell,raster";
+    output = G_define_standard_option(G_OPT_R_OUTPUT);
 
     ml = G_define_flag();
     ml->key = 'm';
@@ -53,7 +40,7 @@
     quiet->key = 'q';
     quiet->description = _("Run quietly");
 
-    if (G_parser(argc,argv)) exit(1);
+    if (G_parser(argc,argv)) exit(EXIT_FAILURE);
 
     parms->quiet = quiet->answer;
     parms->ml = ml->answer;



More information about the grass-commit mailing list