Changeset: a460c5d1060d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a460c5d1060d
Modified Files:
        clients/mapiclient/mclient.1
        clients/mapiclient/mclient.c
Branch: Mar2025
Log Message:

Added --quiet (-q) option to mclient to not print welcome message.


diffs (60 lines):

diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1
--- a/clients/mapiclient/mclient.1
+++ b/clients/mapiclient/mclient.1
@@ -120,6 +120,9 @@ Print usage information and exit.
 \fB\-\-version\fP (\fB\-v\fP)
 Print version information and exit.
 .TP
+\fB\-\-quiet\fP (\fB\-q\fP)
+Be quiet: don't print welcome message at startup.
+.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
@@ -3355,6 +3355,7 @@ main(int argc, char **argv)
        bool trace = false;
        bool dump = false;
        bool useinserts = false;
+       bool quiet = false;
        int c = 0;
        Mapi mid;
        bool save_history = false;
@@ -3387,6 +3388,7 @@ main(int argc, char **argv)
                {"pager", 1, 0, '|'},
 #endif
                {"port", 1, 0, 'p'},
+               {"quiet", 0, 0, 'q'},
                {"rows", 1, 0, 'r'},
                {"statement", 1, 0, 's'},
                {"user", 1, 0, 'u'},
@@ -3469,7 +3471,7 @@ main(int argc, char **argv)
 #ifdef HAVE_ICONV
                                "E:"
 #endif
-                               "f:h:Hil:L:n:Np:P:r:Rs:t:u:vw:Xz"
+                               "f:h:Hil:L:n:Np:P:qr:Rs:t:u:vw:Xz"
 #ifdef HAVE_POPEN
                                "|:"
 #endif
@@ -3553,6 +3555,9 @@ main(int argc, char **argv)
                        passwd = optarg;
                        passwd_set_as_flag = true;
                        break;
+               case 'q':
+                       quiet = true;
+                       break;
                case 'r':
                        assert(optarg);
                        rowsperpage = atoi(optarg);
@@ -3765,7 +3770,7 @@ main(int argc, char **argv)
 
        mapi_trace(mid, trace);
        /* give the user a welcome message with some general info */
-       if (!has_fileargs && command == NULL && isatty(fileno(stdin))) {
+       if (!quiet && !has_fileargs && command == NULL && 
isatty(fileno(stdin))) {
                char *lang;
 
                catch_interrupts(mid);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to