浏览代码

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 年之前
父节点
当前提交
8c7e1c5874
共有 1 个文件被更改,包括 6 次插入5 次删除
  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;