[GRASS-SVN] r47072 - grass/trunk/display/d.erase

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jul 9 10:05:02 EDT 2011


Author: martinl
Date: 2011-07-09 07:05:02 -0700 (Sat, 09 Jul 2011)
New Revision: 47072

Modified:
   grass/trunk/display/d.erase/main.c
Log:
d.erase: updated for d.mon
	 standardize option (color -> bgcolor)


Modified: grass/trunk/display/d.erase/main.c
===================================================================
--- grass/trunk/display/d.erase/main.c	2011-07-09 14:03:36 UTC (rev 47071)
+++ grass/trunk/display/d.erase/main.c	2011-07-09 14:05:02 UTC (rev 47072)
@@ -4,7 +4,7 @@
  * MODULE:       d.erase
  * AUTHOR(S):    James Westervelt - USA CERL
  * PURPOSE:      Erase the current display frame with user defined color.
- * COPYRIGHT:    (C) 2000 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2000, 2011 by the GRASS Development Team
  *
  *               This program is free software under the GNU General Public
  *               License (>=v2). Read the file COPYING that comes with GRASS
@@ -27,29 +27,25 @@
 
     module = G_define_module();
     G_add_keyword(_("display"));
-    G_add_keyword(_("setup"));
+    G_add_keyword(_("graphics"));
+    G_add_keyword(_("monitors"));
+    G_add_keyword(_("CLI"));
     module->description =
-	_("Erase the contents of the active display frame with user defined color");
+	_("Erases the contents of the active graphics display frame with user defined color.");
 
-    color = G_define_option();
-    color->key = "color";
-    color->type = TYPE_STRING;
-    color->required = NO;
-    color->answer = DEFAULT_BG_COLOR;
-    color->description =
-	_("Color to erase with, either a standard GRASS color or R:G:B triplet (separated by colons)");
-    color->gisprompt = "old_color,color,color";
-
+    color = G_define_standard_option(G_OPT_C_BG);
+    
     eraseframe = G_define_flag();
     eraseframe->key = 'f';
     eraseframe->description = _("Remove all frames and erase the screen");
 
     if (G_parser(argc, argv))
-	exit(1);
+	exit(EXIT_FAILURE);
 
     if (D_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected"));
-
+	G_fatal_error(_("No graphics device selected. "
+			"Use d.mon to select graphics device."));
+    
     D_setup_unity(0);
 
     D_erase(color->answer);
@@ -57,7 +53,8 @@
     if (eraseframe->answer)
 	D__erase();
 
+    D_save_command(NULL);
     D_close_driver();
 
-    exit(0);
+    exit(EXIT_SUCCESS);
 }



More information about the grass-commit mailing list