|
@@ -9,7 +9,7 @@
|
|
|
* Markus Neteler <neteler itc.it>
|
|
|
* Stephan Holl
|
|
|
* PURPOSE: Process one sql select statement
|
|
|
- * COPYRIGHT: (C) 2002-2009 by the GRASS Development Team
|
|
|
+ * COPYRIGHT: (C) 2002-2010 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
|
|
@@ -187,20 +187,6 @@ static void parse_command_line(int argc, char **argv)
|
|
|
/* Initialize the GIS calls */
|
|
|
G_gisinit(argv[0]);
|
|
|
|
|
|
- table = G_define_standard_option(G_OPT_DB_TABLE);
|
|
|
- table->guisection = _("Query");
|
|
|
-
|
|
|
- database = G_define_standard_option(G_OPT_DB_DATABASE);
|
|
|
- if ((db = db_get_default_database_name()))
|
|
|
- database->answer = (char *) db;
|
|
|
- database->guisection = _("Query");
|
|
|
-
|
|
|
- driver = G_define_standard_option(G_OPT_DB_DRIVER);
|
|
|
- driver->options = db_list_drivers();
|
|
|
- if ((drv = db_get_default_driver_name()))
|
|
|
- driver->answer = (char *) drv;
|
|
|
- driver->guisection = _("Query");
|
|
|
-
|
|
|
sql = G_define_option();
|
|
|
sql->key = "sql";
|
|
|
sql->type = TYPE_STRING;
|
|
@@ -212,9 +198,23 @@ static void parse_command_line(int argc, char **argv)
|
|
|
|
|
|
input = G_define_standard_option(G_OPT_F_INPUT);
|
|
|
input->required = NO;
|
|
|
- input->description = _("Name of file with sql statement");
|
|
|
+ input->description = _("Name of file with SQL select statement(s)");
|
|
|
input->guisection = _("Query");
|
|
|
+
|
|
|
+ table = G_define_standard_option(G_OPT_DB_TABLE);
|
|
|
+ table->guisection = _("Connection");
|
|
|
+
|
|
|
+ database = G_define_standard_option(G_OPT_DB_DATABASE);
|
|
|
+ if ((db = db_get_default_database_name()))
|
|
|
+ database->answer = (char *) db;
|
|
|
+ database->guisection = _("Connection");
|
|
|
|
|
|
+ driver = G_define_standard_option(G_OPT_DB_DRIVER);
|
|
|
+ driver->options = db_list_drivers();
|
|
|
+ if ((drv = db_get_default_driver_name()))
|
|
|
+ driver->answer = (char *) drv;
|
|
|
+ driver->guisection = _("Connection");
|
|
|
+
|
|
|
fs = G_define_standard_option(G_OPT_F_SEP);
|
|
|
fs->description = _("Output field separator");
|
|
|
fs->guisection = _("Format");
|