[GRASS-SVN] r51940 - in grass/trunk: db/db.select include lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jun 2 09:40:58 PDT 2012
Author: martinl
Date: 2012-06-02 09:40:57 -0700 (Sat, 02 Jun 2012)
New Revision: 51940
Modified:
grass/trunk/db/db.select/main.c
grass/trunk/include/gis.h
grass/trunk/lib/gis/parser_standard_options.c
Log:
libgis: introduce G_OPT_DB_SQL
use standarized option in db.select
Modified: grass/trunk/db/db.select/main.c
===================================================================
--- grass/trunk/db/db.select/main.c 2012-06-02 16:00:24 UTC (rev 51939)
+++ grass/trunk/db/db.select/main.c 2012-06-02 16:40:57 UTC (rev 51940)
@@ -191,13 +191,7 @@
/* Initialize the GIS calls */
G_gisinit(argv[0]);
- sql = G_define_option();
- sql->key = "sql";
- sql->type = TYPE_STRING;
- sql->required = NO;
- sql->label = _("SQL select statement ('-' for standard input)");
- sql->description =
- _("For example: 'select * from rybniky where kapri = 'hodne'");
+ sql = G_define_standard_option(G_OPT_DB_SQL);
sql->guisection = _("Query");
input = G_define_standard_option(G_OPT_F_INPUT);
Modified: grass/trunk/include/gis.h
===================================================================
--- grass/trunk/include/gis.h 2012-06-02 16:00:24 UTC (rev 51939)
+++ grass/trunk/include/gis.h 2012-06-02 16:40:57 UTC (rev 51940)
@@ -172,6 +172,7 @@
/**/ typedef enum
{
G_OPT_UNDEFINED,
+ G_OPT_DB_SQL, /* SQL statements /*
G_OPT_DB_WHERE, /* SQL where conditions */
G_OPT_DB_TABLE, /* table name */
G_OPT_DB_DRIVER, /* driver name */
Modified: grass/trunk/lib/gis/parser_standard_options.c
===================================================================
--- grass/trunk/lib/gis/parser_standard_options.c 2012-06-02 16:00:24 UTC (rev 51939)
+++ grass/trunk/lib/gis/parser_standard_options.c 2012-06-02 16:40:57 UTC (rev 51940)
@@ -30,6 +30,7 @@
be returned (not NULL).
- database:
+ - G_OPT_DB_SQL
- G_OPT_DB_WHERE
- G_OPT_DB_TABLE
- G_OPT_DB_DRIVER
@@ -123,6 +124,16 @@
Opt = G_define_option();
switch (opt) {
+ case G_OPT_DB_SQL:
+ Opt->key = "sql";
+ Opt->type = TYPE_STRING;
+ Opt->key_desc = "sql_query";
+ Opt->required = NO;
+ Opt->label = _("SQL select statement");
+ Opt->description =
+ _("For example: 'select * from rybniky where kapri = 'hodne'\n"
+ "\t\t('-' for standard input)");
+ break;
case G_OPT_DB_WHERE:
Opt->key = "where";
Opt->type = TYPE_STRING;
More information about the grass-commit
mailing list