[GRASS-SVN] r53599 - grass/trunk/db/db.tables

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 28 11:16:07 PDT 2012


Author: martinl
Date: 2012-10-28 11:16:07 -0700 (Sun, 28 Oct 2012)
New Revision: 53599

Modified:
   grass/trunk/db/db.tables/main.c
Log:
db.tables: msg cosmetics


Modified: grass/trunk/db/db.tables/main.c
===================================================================
--- grass/trunk/db/db.tables/main.c	2012-10-28 18:09:03 UTC (rev 53598)
+++ grass/trunk/db/db.tables/main.c	2012-10-28 18:16:07 UTC (rev 53599)
@@ -18,18 +18,15 @@
 #include <grass/dbmi.h>
 #include <grass/glocale.h>
 
-
 struct
 {
     char *driver, *database;
     int s;
 } parms;
 
-
 /* function prototypes */
 static void parse_command_line(int, char **);
 
-
 int main(int argc, char **argv)
 {
     dbDriver *driver;
@@ -51,17 +48,20 @@
 
     system_tables = parms.s;
     if (db_list_tables(driver, &names, &count, system_tables) != DB_OK)
-	exit(ERROR);
+        G_fatal_error(_("Unable to list tables from database <%s>"), parms.database);
+    
     for (i = 0; i < count; i++)
 	fprintf(stdout, "%s\n", db_get_string(&names[i]));
 
+    if (count < 1)
+        G_important_message(_("No tables found"));
+
     db_close_database(driver);
     db_shutdown_driver(driver);
 
     exit(EXIT_SUCCESS);
 }
 
-
 static void parse_command_line(int argc, char **argv)
 {
     struct Option *driver, *database;



More information about the grass-commit mailing list