Changeset: ea2cdf89ecbc for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ea2cdf89ecbc Modified Files: clients/ChangeLog clients/mapiclient/mclient.1 clients/mapiclient/mclient.c Branch: default Log Message:
mclient: make SQL language default diffs (92 lines): diff --git a/clients/ChangeLog b/clients/ChangeLog --- a/clients/ChangeLog +++ b/clients/ChangeLog @@ -1,3 +1,7 @@ # ChangeLog file for clients # This file is updated with Maddlog +* Thu Feb 3 2011 Fabian Groffen <[email protected]> +- Make SQL the default language for mclient, e.g. to use when --language= + or -l is omitted + diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1 --- a/clients/mapiclient/mclient.1 +++ b/clients/mapiclient/mclient.1 @@ -3,7 +3,6 @@ mclient \- the MonetDB command-line tool .SH SYNOPSIS .B mclient -.BI \-\-language= language [ .I options ] [ @@ -18,7 +17,7 @@ automatic index management, extensibility of data types and search accelerators, SQL- and XML- frontends. .PP -.I Mclient +.I mclient is the command-line interface to the MonetDB server. .PP If the @@ -96,11 +95,11 @@ and .BR sql . A unique prefix suffices. -The +When the .B \-\-language -option is required unless the -.B \-\-help -option is given. +option is omitted, the default of +.B sql +is assumed. .TP \fB\-\-help\fP (\fB\-?\fP) Print usage information and exit. If preceded by the diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -100,18 +100,17 @@ #endif enum modes { - NOLANGUAGE, MAL, SQL }; -static enum modes mode = NOLANGUAGE; +static enum modes mode = SQL; static stream *toConsole; static stream *toConsole_raw; /* toConsole without iconv conversion */ static stream *stdout_stream; static stream *stderr_stream; static FILE *fromConsole = NULL; -static char *language = NULL; +static char *language = "sql"; static char *logfile = NULL; static char promptbuf[16]; static int echoquery = 0; @@ -2370,7 +2369,7 @@ static void usage(const char *prog, int xit) { - fprintf(stderr, "Usage: %s --language=(sql|mal) [ options ]\n", prog); + fprintf(stderr, "Usage: %s [ options ]\n", prog); fprintf(stderr, "\nOptions are:\n"); #ifdef HAVE_SYS_UN_H fprintf(stderr, " -h hostname | --host=hostname host or UNIX domain socket to connect to\n"); @@ -2704,11 +2703,6 @@ usage(argv[0], -1); } } - /* language value is mandatory */ - if (mode == NOLANGUAGE) { - fprintf(stderr, "Please specify a language option\n\n"); - usage(argv[0], -1); - } #ifdef HAVE_ICONV #ifdef HAVE_NL_LANGINFO if (encoding == NULL) _______________________________________________ Checkin-list mailing list [email protected] http://mail.monetdb.org/mailman/listinfo/checkin-list
