[GRASS-SVN] r69643 - grass/trunk/display/d.legend.vect

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 2 17:44:59 PDT 2016


Author: annakrat
Date: 2016-10-02 17:44:59 -0700 (Sun, 02 Oct 2016)
New Revision: 69643

Modified:
   grass/trunk/display/d.legend.vect/main.c
Log:
d.legend.vect: separator option currently works only for user provided input file - make it explicit in the code

Modified: grass/trunk/display/d.legend.vect/main.c
===================================================================
--- grass/trunk/display/d.legend.vect/main.c	2016-10-02 23:01:30 UTC (rev 69642)
+++ grass/trunk/display/d.legend.vect/main.c	2016-10-03 00:44:59 UTC (rev 69643)
@@ -167,6 +167,10 @@
     fl_bg->description = _("Display legend background");
     fl_bg->guisection = _("Background");
 
+    opt_sep = G_define_standard_option(G_OPT_F_SEP);
+    opt_sep->guisection = _("In/Out");
+    opt_sep->label = _("Field separator for input file");
+
     opt_input = G_define_standard_option(G_OPT_F_INPUT);
     opt_input->label = _("Input legend file");
     opt_input->description = _("Path to legend file ");
@@ -180,8 +184,6 @@
     opt_output->required = NO;
     opt_output->guisection = _("In/Out");
 
-    opt_sep = G_define_standard_option(G_OPT_F_SEP);
-    opt_sep->guisection = _("In/Out");
 
     /* Check command line */
     if (G_parser(argc, argv)) {
@@ -250,14 +252,14 @@
     fontcolor = D_parse_color(opt_fontcolor->answer, FALSE); /*default color: black */
 
     /* I/O */
-    sep = G_option_to_separator(opt_sep);
-
     if (opt_input->answer) {
+        sep = G_option_to_separator(opt_sep);
         file_name = opt_input->answer;
         if (!file_name)
             G_fatal_error(_("Unable to open input file <%s>"), file_name);
     }
     else {
+        sep = "|";
         file_name = getenv("GRASS_LEGEND_FILE");
         if (!file_name)
             G_fatal_error("No legend file defined.");



More information about the grass-commit mailing list