Changeset: 19e7d55cb1f1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=19e7d55cb1f1
Modified Files:
        clients/mapiclient/Tests/mclient--help.stable.err
        clients/mapiclient/Tests/stethoscope--help.stable.err
        clients/mapiclient/mclient.1
        clients/mapiclient/mclient.c
        clients/mapiclient/msqldump.c
        clients/mapiclient/stethoscope.c
        tools/mserver/mserver5.1
        tools/mserver/mserver5.c
Branch: Feb2013
Log Message:

Merged with Oct2012 branch.


diffs (205 lines):

diff --git a/clients/mapiclient/Tests/mclient--help.stable.err 
b/clients/mapiclient/Tests/mclient--help.stable.err
--- a/clients/mapiclient/Tests/mclient--help.stable.err
+++ b/clients/mapiclient/Tests/mclient--help.stable.err
@@ -28,6 +28,7 @@ Options are:
  -X          | --Xdebug          trace mapi network interaction
  -z          | --timezone         do not tell server our timezone
  -| cmd      | --pager=cmd        for pagination
+ -v          | --version          show version information and exit
  -?          | --help             show this usage message
 
 SQL specific opions 
diff --git a/clients/mapiclient/Tests/stethoscope--help.stable.err 
b/clients/mapiclient/Tests/stethoscope--help.stable.err
--- a/clients/mapiclient/Tests/stethoscope--help.stable.err
+++ b/clients/mapiclient/Tests/stethoscope--help.stable.err
@@ -16,6 +16,7 @@ stethoscope [options] +[trace options] {
   -P | --password=<password>
   -p | --port=<portnr>
   -h | --host=<hostname>
+  -? | --help
 
 The trace options (default 'ISTest'):
   S = monitor start of instruction profiling
diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1
--- a/clients/mapiclient/mclient.1
+++ b/clients/mapiclient/mclient.1
@@ -86,6 +86,9 @@ General Options
 \fB\-\-help\fP (\fB\-?\fP)
 Print usage information and exit.
 .TP
+\fB\-\-version\fP (\fB\-v\fP)
+Print version information and exit.
+.TP
 \fB\-\-encoding=\fP\fIencoding\fP (\fB\-E\fP \fIencoding\fP)
 Specify the character encoding of the input.  The option applies to
 both the standard input of
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -2613,6 +2613,7 @@ usage(const char *prog, int xit)
 #ifdef HAVE_POPEN
        fprintf(stderr, " -| cmd      | --pager=cmd        for pagination\n");
 #endif
+       fprintf(stderr, " -v          | --version          show version 
information and exit\n");
        fprintf(stderr, " -?          | --help             show this usage 
message\n");
 
        fprintf(stderr, "\nSQL specific opions \n");
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -104,7 +104,7 @@ main(int argc, char **argv)
                {"functions", 0, 0, 'f'},
                {"table", 1, 0, 't'},
                {"inserts", 0, 0, 'N'},
-               {"Xdebug", 2, 0, 'X'},
+               {"Xdebug", 0, 0, 'X'},
                {"user", 1, 0, 'u'},
                {"quiet", 0, 0, 'q'},
                {"help", 0, 0, '?'},
@@ -172,7 +172,7 @@ main(int argc, char **argv)
                mnstr_destroy(config);
        }
 
-       while ((c = getopt_long(argc, argv, "h:p:d:Dft:NX::u:q?", long_options, 
NULL)) != -1) {
+       while ((c = getopt_long(argc, argv, "h:p:d:Dft:NXu:q?", long_options, 
NULL)) != -1) {
                switch (c) {
                case 'u':
                        user = optarg;
diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -119,6 +119,7 @@ usage(void)
        fprintf(stderr, "  -P | --password=<password>\n");
        fprintf(stderr, "  -p | --port=<portnr>\n");
        fprintf(stderr, "  -h | --host=<hostname>\n");
+       fprintf(stderr, "  -? | --help\n");
        fprintf(stderr, "\n");
        fprintf(stderr, "The trace options (default '%s'):\n",COUNTERSDEFAULT);
        fprintf(stderr, "  S = monitor start of instruction profiling\n");
@@ -396,9 +397,14 @@ main(int argc, char **argv)
                        host = optarg;
                        break;
                case '?':
+                       usage();
+                       /* a bit of a hack: look at the option that the
+                          current `c' is based on and see if we recognize
+                          it: if -? or --help, exit with 0, else with -1 */
+                       exit(strcmp(argv[optind - 1], "-?") == 0 || 
strcmp(argv[optind - 1], "--help") == 0 ? 0 : -1);
                default:
                        usage();
-                       exit(0);
+                       exit(-1);
                }
        }
 
diff --git a/tools/mserver/mserver5.1 b/tools/mserver/mserver5.1
--- a/tools/mserver/mserver5.1
+++ b/tools/mserver/mserver5.1
@@ -112,7 +112,7 @@ integer, which value can be (a combinati
                              for debugging (GDK developers, only)
   134217728 = OPTMASK      = trace the actions, decisions and
                              effects of MAL optimizers
-  268435456 = HEAPMASK   = trace/debug HEAPextend;
+  268435456 = HEAPMASK     = trace/debug HEAPextend;
                              used only for development & debugging
   536870912 = FORCEMITOMASK = forcefully activate mitosis even on
                               small tables, i.e., split small tables
@@ -130,12 +130,13 @@ integer, which value can be (a combinati
 Note that mserver5 recognizes a series of command line options that sets
 one or more of these debug flags as well:
 .EX
-  --threads       (1 | PARMASK)
-  --memory        (MEMMASK)
+  --threads       (THRDMASK | PARMASK)
+  --memory        (MEMMASK | ALLOCMASK)
   --properties    (CHECKMASK | PROPMASK | BATMASK)
   --io            (IOMASK | PERFMASK)
+  --heaps         (HEAPMASK) 
   --transactions  (TMMASK | DELTAMASK | TEMMASK)
-  --modules       (DLMASK | LOADMASK)
+  --modules       (LOADMASK)
   --algorithms    (ALGOMASK | ESTIMASK)
   --xproperties   (XPROPMASK )
   --performance   (JOINPROPMASK | DEADBEEFMASK)
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -76,11 +76,11 @@ mserver_abort()
 }
 #endif
 
-static void usage(char *prog)
+static void usage(char *prog, int xit)
 __attribute__((__noreturn__));
 
 static void
-usage(char *prog)
+usage(char *prog, int xit)
 {
        fprintf(stderr, "Usage: %s [options] [scripts]\n", prog);
        fprintf(stderr, "    --dbpath=<directory>      Specify database 
location\n");
@@ -108,7 +108,7 @@ usage(char *prog)
        fprintf(stderr, "     --forcemito\n");
        fprintf(stderr, "     --debug=<bitmask>\n");
 
-       exit(0);
+       exit(xit);
 }
 
 static void
@@ -228,7 +228,7 @@ main(int argc, char **av)
                { "memory", 0, 0, 0 },
                { "properties", 0, 0, 0 },
                { "io", 0, 0, 0 },
-               { "transaction", 0, 0, 0 },
+               { "transactions", 0, 0, 0 },
                { "modules", 0, 0, 0 },
                { "algorithms", 0, 0, 0 },
                { "optimizers", 0, 0, 0 },
@@ -275,12 +275,12 @@ main(int argc, char **av)
        binpath = get_bin_path();
 
        if (!(setlen = mo_builtin_settings(&set)))
-               usage(prog);
+               usage(prog, -1);
 
        for (;;) {
                int option_index = 0;
 
-               int c = getopt_long(argc, av, "c:d::t:rh?s:m:i:a:e:x:h",
+               int c = getopt_long(argc, av, "c:d::trs:h?",
                                long_options, &option_index);
 
                if (c == -1)
@@ -362,7 +362,7 @@ main(int argc, char **av)
                                grpdebug |= GRPheaps;
                                break;
                        }
-                       usage(prog);
+                       usage(prog, -1);
                /* not reached */
                case 'c':
                        setlen = mo_add_option(&set, setlen, opt_cmdline, 
"config", optarg);
@@ -395,16 +395,19 @@ main(int argc, char **av)
                        break;
                case 'h':
                case '?':
-                       usage(prog);
+                       /* a bit of a hack: look at the option that the
+                          current `c' is based on and see if we recognize
+                          it: if -? or --help, exit with 0, else with -1 */
+                       usage(prog, strcmp(av[optind - 1], "-?") == 0 || 
strcmp(av[optind - 1], "--help") == 0 ? 0 : -1);
                default:
                        fprintf(stderr, "ERROR: getopt returned character "
                                                        "code '%c' 0%o\n", c, 
c);
-                       usage(prog);
+                       usage(prog, -1);
                }
        }
 
        if (!(setlen = mo_system_config(&set, setlen)))
-               usage(prog);
+               usage(prog, -1);
 
        if (debug || grpdebug) {
                long_str buf;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to