Update of /cvsroot/monetdb/clients/src/mapiclient
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4545/src/mapiclient

Modified Files:
        msqldump.c 
Log Message:
Removed --config (-c) and --set (-S) options from msqldump.  It does
not need to read the server config file.  The only reason for reading
this file was to get default values for host (localhost) and port
(50000).


Index: msqldump.c
===================================================================
RCS file: /cvsroot/monetdb/clients/src/mapiclient/msqldump.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- msqldump.c  13 Aug 2007 12:26:49 -0000      1.4
+++ msqldump.c  11 Sep 2007 12:59:08 -0000      1.5
@@ -17,7 +17,14 @@
  */
 
 #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>
@@ -34,7 +41,6 @@
 {
        fprintf(stderr, "Usage: %s [ options ]\n", prog);
        fprintf(stderr, "Options are:\n");
-       fprintf(stderr, " -c config   | --config=file    /* config filename 
*/\n");
        fprintf(stderr, " -h hostname | --host=hostname  /* host to connect to 
*/\n");
        fprintf(stderr, " -P passwd   | --passwd=passwd  /* password */\n");
        fprintf(stderr, " -p portnr   | --port=portnr    /* port to connect to 
*/\n");
@@ -52,8 +58,6 @@
 int
 main(int argc, char **argv)
 {
-       opt *set = NULL;
-       int setlen;
        int port = 0;
        char *user = NULL;
        char *passwd = NULL;
@@ -65,12 +69,10 @@
        Mapi mid;
        int quiet = 0;
        static struct option long_options[] = {
-               {"config", 1, 0, 'c'},
                {"host", 1, 0, 'h'},
                {"passwd", 2, 0, 'P'},
                {"port", 1, 0, 'p'},
                {"database", 1, 0, 'd'},
-               {"set", 1, 0, 'S'},
                {"trace", 2, 0, 't'},
                {"user", 2, 0, 'u'},
                {"quiet", 0, 0, 'q'},
@@ -78,14 +80,8 @@
                {0, 0, 0, 0}
        };
 
-       if ((setlen = mo_builtin_settings(&set)) == 0)
-               usage(argv[0]);
-
-       while ((c = getopt_long(argc, argv, "c:u::p:P::d:qh:s:t::?", 
long_options, NULL)) != -1) {
+       while ((c = getopt_long(argc, argv, "u::p:P::d:qh:t::?", long_options, 
NULL)) != -1) {
                switch (c) {
-               case 'c':
-                       setlen = mo_add_option(&set, setlen, opt_cmdline, 
"config", optarg);
-                       break;
                case 'u':
                        guest = 0;
                        user = optarg; /* can be NULL */
@@ -99,7 +95,6 @@
                        break;
                case 'p':
                        port = atoi(optarg);
-                       setlen = mo_add_option(&set, setlen, opt_cmdline, 
"port", optarg);
                        break;
                case 'd':
                        dbname = optarg;
@@ -110,16 +105,6 @@
                case 't':
                        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 '?':
                        usage(argv[0]);
                default:
@@ -127,25 +112,6 @@
                }
        }
 
-       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 (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

Reply via email to