Update of /cvsroot/monetdb/MonetDB5/src/tools
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv20106
Modified Files:
monetdb.1 monetdb.mx
Log Message:
"GNUification after Solarishisms":
Make status command default to listing all databases, instead of
requiring -a flag for that. This makes the command a bit more
convenient to use, and avoids Martin's confusion.
Index: monetdb.1
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/tools/monetdb.1,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- monetdb.1 2 Sep 2007 20:56:16 -0000 1.1
+++ monetdb.1 6 Sep 2007 10:45:56 -0000 1.2
@@ -64,10 +64,9 @@
Use the
.B lock
command to take a database under maintenance.
-.IP "status [\-als] [database ...]"
-Shows the state of the given database(s) or, when
-.I \-a
-is supplied, all known databases. Three modes control the level of
+.IP "status [\-ls] [database ...]"
+Shows the state of the given database(s) or, when none given, all known
+databases. Three modes control the level of
detail in the displayed output. By default the most used properties of
a database are being shown. This includes the state of the database
(running, crashed, stopped), whether it is under maintenance or not, the
@@ -87,9 +86,7 @@
resembles pretty much the output of various
.B XXXstat
functions, and is ideal for quickly gaining an overview of the system
-state in combination with the
-.I \-a
-flag.
+state.
.IP "start [\-a] [database ...]"
.IP "stop [\-a] [database ...]"
.IP "kill [\-a] [database ...]"
Index: monetdb.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/tools/monetdb.mx,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- monetdb.mx 5 Sep 2007 17:06:16 -0000 1.28
+++ monetdb.mx 6 Sep 2007 10:45:56 -0000 1.29
@@ -109,11 +109,11 @@
printf(" database is available again for normal use. Use
the\n");
printf(" \"lock\" command to take a database under
maintenance.\n");
} else if (strcmp(argv[1], "status") == 0) {
- printf("Usage: monetdb status [-als] [database ...]\n");
- printf(" Shows the state of a given database. Various
options\n");
+ printf("Usage: monetdb status [-ls] [database ...]\n");
+ printf(" Shows the state of a given database, or all known if
none\n");
+ printf(" given. Instead of the normal mode, a long and short
mode\n");
printf(" control what information is displayed.\n");
printf("Options:\n");
- printf(" -a list status of all databases\n");
printf(" -l use long listing\n");
printf(" -s use short one-line listing\n");
} else if (strcmp(argv[1], "start") == 0) {
@@ -356,18 +356,14 @@
static void
command_status(int argc, char *argv[])
{
- int doall = 0;
+ int doall = 1; /* we default to showing all */
int mode = 0; /* 0=normal, 1=short, 2=long */
int i;
char *p;
str e;
sabdb *stats;
- if (argc == 1) {
- /* print help message for this command */
- command_help(2, &argv[-1]);
- exit(1);
- } else if (argc == 0) {
+ if (argc == 0) {
exit(2);
}
@@ -376,9 +372,6 @@
if (argv[i][0] == '-') {
for (p = argv[i] + 1; *p != '\0'; p++) {
switch (*p) {
- case 'a':
- doall = 1;
- break;
case 's':
mode = 1;
break;
@@ -387,6 +380,8 @@
break;
case '-':
if (p[1] == '\0') {
+ if (argc - 1 > i)
+ doall = 0;
i = argc;
break;
}
@@ -400,6 +395,8 @@
/* make this option no longer available, for easy use
* lateron */
argv[i] = NULL;
+ } else {
+ doall = 0;
}
}
@@ -430,7 +427,6 @@
return;
}
- doall = 0; /* temporarily misuse this as db counter */
for (i = 1; i < argc; i++) {
if (argv[i] != NULL) {
if ((e = SABAOTHgetStatus(&stats, argv[i])) !=
MAL_SUCCEED) {
@@ -445,14 +441,8 @@
printStatus(stats, mode);
SABAOTHfreeStatus(&stats);
}
- doall++;
}
}
-
- if (doall == 0) {
- command_help(2, &argv[-1]);
- exit(1);
- }
}
typedef enum {
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins