[GRASS-SVN] r62985 - grass/trunk/misc/m.cogo

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Nov 26 02:07:49 PST 2014


Author: martinl
Date: 2014-11-26 02:07:49 -0800 (Wed, 26 Nov 2014)
New Revision: 62985

Modified:
   grass/trunk/misc/m.cogo/main.c
Log:
m.cogo use standardized options (#2409)

Modified: grass/trunk/misc/m.cogo/main.c
===================================================================
--- grass/trunk/misc/m.cogo/main.c	2014-11-26 10:07:04 UTC (rev 62984)
+++ grass/trunk/misc/m.cogo/main.c	2014-11-26 10:07:49 UTC (rev 62985)
@@ -208,7 +208,6 @@
     struct Option *output;
     struct Option *coords;
     struct Flag *format;
-    struct Flag *quiet;
     struct Flag *reverse;
     struct Flag *close;
     struct GModule *module;
@@ -216,7 +215,6 @@
     struct survey_record record, first_record;
     const char *cptr;
     char *ss;
-    int verbose = TRUE;
     unsigned long linenum = 0, dataline = 0;
     int (*parse_line) (const char *, struct survey_record *);
     void (*print_func) (FILE *, struct survey_record *);
@@ -234,10 +232,6 @@
     format->key = 'l';
     format->description = _("Lines are labelled");
 
-    quiet = G_define_flag();
-    quiet->key = 'q';
-    quiet->description = _("Suppress warnings");
-
     reverse = G_define_flag();
     reverse->key = 'r';
     reverse->description =
@@ -256,11 +250,7 @@
     output->required = NO;
     output->answer = "-";
 
-    coords = G_define_option();
-    coords->key = "coord";
-    coords->key_desc = "x,y";
-    coords->type = TYPE_DOUBLE;
-    coords->required = NO;
+    coords = G_define_standard_option(G_OPT_M_COORDS);
     coords->description = _("Starting coordinate pair");
     coords->answer = "0.0,0.0";
 
@@ -295,9 +285,6 @@
 	record.haslabel = NO;
     }
 
-    if (quiet->answer)
-	verbose = FALSE;
-
     if (reverse->answer) {
 	parse_line = parse_reverse;
 	print_func = print_cogo;
@@ -328,8 +315,7 @@
 	}
 
 	if (!parse_line(cptr, &record)) {
-	    if (verbose)
-		G_warning(_("Input parse error on line %lu"), linenum);
+            G_warning(_("Input parse error on line %lu"), linenum);
 	    continue;
 	}
 



More information about the grass-commit mailing list