[GRASS-SVN] r60614 - grass/trunk/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 30 09:05:08 PDT 2014


Author: hcho
Date: 2014-05-30 09:05:08 -0700 (Fri, 30 May 2014)
New Revision: 60614

Modified:
   grass/trunk/lib/gis/parser.c
   grass/trunk/lib/gis/parser_standard_options.c
Log:
G_OPT_F_SEP: added "pipe" for "|"

Modified: grass/trunk/lib/gis/parser.c
===================================================================
--- grass/trunk/lib/gis/parser.c	2014-05-30 15:54:39 UTC (rev 60613)
+++ grass/trunk/lib/gis/parser.c	2014-05-30 16:05:08 UTC (rev 60614)
@@ -1448,15 +1448,17 @@
     if (option->answer == NULL)
         G_fatal_error(_("No separator given"));
 
-    if (strcmp(option->answer, "space") == 0)
+    if (strcmp(option->answer, "pipe") == 0)
+        sep = G_store("|");
+    else if (strcmp(option->answer, "comma") == 0)
+        sep = G_store(",");
+    else if (strcmp(option->answer, "space") == 0)
 	sep = G_store(" ");
     else if (strcmp(option->answer, "tab") == 0 ||
              strcmp(option->answer, "\\t") == 0)
         sep = G_store("\t");
     else if (strcmp(option->answer, "newline") == 0)
         sep = G_store("\n");
-    else if (strcmp(option->answer, "comma") == 0)
-        sep = G_store(",");
     else
         sep = G_store(option->answer);
     

Modified: grass/trunk/lib/gis/parser_standard_options.c
===================================================================
--- grass/trunk/lib/gis/parser_standard_options.c	2014-05-30 15:54:39 UTC (rev 60613)
+++ grass/trunk/lib/gis/parser_standard_options.c	2014-05-30 16:05:08 UTC (rev 60614)
@@ -553,9 +553,9 @@
 	Opt->type = TYPE_STRING;
 	Opt->key_desc = "character";
 	Opt->required = NO;
-	Opt->answer = "|";
+	Opt->answer = "pipe";
 	Opt->label = _("Field separator");
-	Opt->description = _("Special characters: newline, space, comma, tab");
+	Opt->description = _("Special characters: pipe, comma, space, tab, newline");
 	break;
 
 	/* colors */



More information about the grass-commit mailing list