Update of /cvsroot/monetdb/clients/src/mapiclient
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32072
Modified Files:
MapiClient.mx
Log Message:
Removed --config (-c) and --set (-S) options. mclient does not need
to read the server config file. The only reason for reading this file
was to get default values for host (localhost), port (50000), and
xquery_output (dm).
Index: MapiClient.mx
===================================================================
RCS file: /cvsroot/monetdb/clients/src/mapiclient/MapiClient.mx,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- MapiClient.mx 8 Sep 2007 15:11:31 -0000 1.85
+++ MapiClient.mx 11 Sep 2007 12:48:35 -0000 1.86
@@ -86,7 +86,14 @@
@+ Implementation
@c
#include "clients_config.h"
-#include <monet_options.h>
+#include "monet_utils.h"
+#ifndef HAVE_GETOPT_LONG
+# include "monet_getopt.h"
+#else
+# ifdef HAVE_GETOPT_H
+# include "getopt.h"
+# endif
+#endif
#include "Mapi.h"
#include <unistd.h>
#include <stdlib.h>
@@ -1458,7 +1465,6 @@
{
fprintf(stderr, "Usage: %s --language=(sql|xquery|mal|mil) [ options
]\n", prog);
fprintf(stderr, "\nOptions are:\n");
- fprintf(stderr, " -c config | --config=file config filename\n");
fprintf(stderr, " -d database | --database=database database to
connect to\n");
fprintf(stderr, " -e | --echo echo the query\n");
@@ -1496,8 +1502,6 @@
int
main(int argc, char **argv)
{
- opt *set = NULL;
- int setlen;
int port = 0;
char *user = NULL;
char *passwd = NULL;
@@ -1516,7 +1520,6 @@
int option_index = 0;
struct stat statb;
static struct option long_options[] = {
- {"config", 1, 0, 'c'},
{"collection", 1, 0, 'C'},
{"dump", 0, 0, 'd'},
{"database", 1, 0, 'd'},
@@ -1535,7 +1538,6 @@
{"rows", 1, 0, 'r'},
{"passwd", 2, 0, 'P'},
{"port", 1, 0, 'p'},
- {"set", 1, 0, 'S'},
{"statement", 1, 0, 's'},
{"time", 0, 0, 't'},
{"Xdebug", 2, 0, 'X'},
@@ -1554,14 +1556,11 @@
mark = NULL;
mark2 = NULL;
- if ((setlen = mo_builtin_settings(&set)) == 0)
- usage(argv[0]);
-
- while ((c = getopt_long(argc, argv, "c:C:d::ef:i::h:L::l:o:"
+ while ((c = getopt_long(argc, argv, "C:d::ef:i::h:L::l:o:"
#ifdef HAVE_POPEN
"|:"
#endif
- "w:r:P::p:S:s:tX::u::H?", long_options,
&option_index)) != -1) {
+ "w:r:P::p:s:tX::u::H?", long_options,
&option_index)) != -1) {
switch (c) {
case 0:
#ifdef HAVE_POPEN
@@ -1571,9 +1570,6 @@
}
#endif
break;
- case 'c':
- setlen = mo_add_option(&set, setlen, opt_cmdline,
"config", optarg);
- break;
case 'C':
colname = optarg;
break;
@@ -1637,7 +1633,6 @@
break;
case 'p':
port = atoi(optarg);
- setlen = mo_add_option(&set, setlen, opt_cmdline,
"port", optarg);
break;
case 'd':
if (optarg == NULL &&
strcmp(long_options[option_index].name, "dump") == 0)
@@ -1665,16 +1660,6 @@
case 'X':
trace = MAPI_TRACE;
break;
- case 'S':{
- char *eq = strchr(optarg, '=');
-
- if (eq)
- *eq = 0;
- setlen = mo_add_option(&set, setlen, opt_cmdline,
optarg, eq ? eq + 1 : "");
- if (eq)
- *eq = '=';
- break;
- }
case 'H':
save_history = 1;
break;
@@ -1694,29 +1679,6 @@
usage(argv[0]);
}
- setlen = mo_system_config(&set, setlen);
-
- if (port == 0) {
- char *s = "mapi_port";
- int p = defaultPort;
-
- if ((s = mo_find_option(set, setlen, s)) != NULL) {
- port = strtol(s, NULL, 10);
- } else {
- port = p;
- }
- }
-
- if (mode == XQUERY && output == NULL) {
- output = mo_find_option(set, setlen, "xquery_output");
- }
-
- if (host == NULL) {
- host = mo_find_option(set, setlen, "host");
- if (host == NULL)
- host = "localhost";
- }
-
/* default to administrator account (eeks) when being called without
* any arguments, default to the current user if -u flag is given */
if (guest) {
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins