Browse Source

Fixed bug in parser introduced with https://trac.osgeo.org/grass/changeset/73525 and https://trac.osgeo.org/grass/changeset/73561

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73578 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 6 years ago
parent
commit
8c7e1c5874
1 changed files with 6 additions and 5 deletions
  1. 6 5
      lib/gis/parser.c

+ 6 - 5
lib/gis/parser.c

@@ -508,17 +508,18 @@ int G_parser(int argc, char **argv)
 	while (--argc) {
 	    ptr = *(++argv);
 
-	    /* JSON print option */
-	    if (strcmp(ptr, "--json") == 0) {
-		print_json = 1;
-	    }
-
 	    if (strcmp(ptr, "help") == 0 || strcmp(ptr, "--h") == 0 ||
 		strcmp(ptr, "-help") == 0 || strcmp(ptr, "--help") == 0) {
 		G_usage();
 		exit(EXIT_SUCCESS);
 	    }
 
+	    /* JSON print option */
+	    if (strcmp(ptr, "--json") == 0) {
+		print_json = 1;
+		continue;
+	    }
+
 	    /* Overwrite option */
 	    if (strcmp(ptr, "--o") == 0 || strcmp(ptr, "--overwrite") == 0) {
 		st->overwrite = 1;