Sfoglia il codice sorgente

m.cogo use standardized options (https://trac.osgeo.org/grass/ticket/2409)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@62985 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 anni fa
parent
commit
83b0404ae8
1 ha cambiato i file con 2 aggiunte e 16 eliminazioni
  1. 2 16
      misc/m.cogo/main.c

+ 2 - 16
misc/m.cogo/main.c

@@ -208,7 +208,6 @@ int main(int argc, char **argv)
     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 @@ int main(int argc, char **argv)
     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 @@ int main(int argc, char **argv)
     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 @@ int main(int argc, char **argv)
     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 @@ int main(int argc, char **argv)
 	record.haslabel = NO;
     }
 
-    if (quiet->answer)
-	verbose = FALSE;
-
     if (reverse->answer) {
 	parse_line = parse_reverse;
 	print_func = print_cogo;
@@ -328,8 +315,7 @@ int main(int argc, char **argv)
 	}
 
 	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;
 	}