Changeset: cf477e9fd274 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cf477e9fd274
Modified Files:
        clients/mapiclient/mclient.c
Branch: Aug2018
Log Message:

Align the showCommands() output of mclient  \?  command.
>From  \D table-  onwards the dash started 1 position earlier than the commands 
>listed above it.
Also print \help command (to show SQL commands) only when mclient is not 
started with -lmal flag.

Output was:

sql>\?
\?       - show this message
\<file   - read input from file
\>file   - save response in file, or stdout if no file is given
\|cmd    - pipe result to process, or stop when no command is given
\history - show the readline history
\help    - synopsis of the SQL syntax
\D table- dumps the table, or the complete database if none given.
\d[Stvsfn]+ [obj] - list database objects, or describe if obj given
\A      - enable auto commit
\a      - disable auto commit
\e      - echo the query in sql formatting mode
\t      - set the timer {none,clock,performance} (none is default)
\f      - format using a built-in renderer {csv,tab,raw,sql,xml,trash,rowcount}
\w#     - set maximal page width (-1=unlimited, 0=terminal width, >0=limit to 
num)
\r#     - set maximum rows per page (-1=raw)
\L file - save client/server interaction
\X      - trace mclient code
\q      - terminate session
sql>

Changed into:

sql>\?
\?       - show this message
\<file   - read input from file
\>file   - save response in file, or stdout if no file is given
\|cmd    - pipe result to process, or stop when no command is given
\history - show the readline history
\help    - synopsis of the SQL syntax
\D table - dumps the table, or the complete database if none given.
\d[Stvsfn]+ [obj] - list database objects, or describe if obj given
\A       - enable auto commit
\a       - disable auto commit
\e       - echo the query in sql formatting mode
\t       - set the timer {none,clock,performance} (none is default)
\f       - format using a built-in renderer {csv,tab,raw,sql,xml,trash,rowcount}
\w#      - set maximal page width (-1=unlimited, 0=terminal width, >0=limit to 
num)
\r#      - set maximum rows per page (-1=raw)
\L file  - save client/server interaction
\X       - trace mclient code
\q       - terminate session
sql>

Or when started with -lmal:

mal>\?
\?       - show this message
?pat     - MAL function help. pat=[modnme[.fcnnme][(][)]] wildcard *
\<file   - read input from file
\>file   - save response in file, or stdout if no file is given
\|cmd    - pipe result to process, or stop when no command is given
\history - show the readline history
\e       - echo the query in sql formatting mode
\t       - set the timer {none,clock,performance} (none is default)
\f       - format using a built-in renderer {csv,tab,raw,sql,xml,trash,rowcount}
\w#      - set maximal page width (-1=unlimited, 0=terminal width, >0=limit to 
num)
\r#      - set maximum rows per page (-1=raw)
\L file  - save client/server interaction
\X       - trace mclient code
\q       - terminate session
mal>


diffs (46 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -2183,7 +2183,7 @@ showCommands(void)
        /* shared control options */
        mnstr_printf(toConsole, "\\?       - show this message\n");
        if (mode == MAL)
-               mnstr_printf(toConsole, "?pat  - MAL function help. 
pat=[modnme[.fcnnme][(][)]] wildcard *\n");
+               mnstr_printf(toConsole, "?pat     - MAL function help. 
pat=[modnme[.fcnnme][(][)]] wildcard *\n");
        mnstr_printf(toConsole, "\\<file   - read input from file\n");
        mnstr_printf(toConsole, "\\>file   - save response in file, or stdout 
if no file is given\n");
 #ifdef HAVE_POPEN
@@ -2192,21 +2192,21 @@ showCommands(void)
 #ifdef HAVE_LIBREADLINE
        mnstr_printf(toConsole, "\\history - show the readline history\n");
 #endif
-       mnstr_printf(toConsole, "\\help    - synopsis of the SQL syntax\n");
        if (mode == SQL) {
-               mnstr_printf(toConsole, "\\D table- dumps the table, or the 
complete database if none given.\n");
+               mnstr_printf(toConsole, "\\help    - synopsis of the SQL 
syntax\n");
+               mnstr_printf(toConsole, "\\D table - dumps the table, or the 
complete database if none given.\n");
                mnstr_printf(toConsole, "\\d[Stvsfn]+ [obj] - list database 
objects, or describe if obj given\n");
-               mnstr_printf(toConsole, "\\A      - enable auto commit\n");
-               mnstr_printf(toConsole, "\\a      - disable auto commit\n");
+               mnstr_printf(toConsole, "\\A       - enable auto commit\n");
+               mnstr_printf(toConsole, "\\a       - disable auto commit\n");
        }
-       mnstr_printf(toConsole, "\\e      - echo the query in sql formatting 
mode\n");
-       mnstr_printf(toConsole, "\\t      - set the timer 
{none,clock,performance} (none is default)\n");
-       mnstr_printf(toConsole, "\\f      - format using a built-in renderer 
{csv,tab,raw,sql,xml,trash,rowcount}\n");
-       mnstr_printf(toConsole, "\\w#     - set maximal page width 
(-1=unlimited, 0=terminal width, >0=limit to num)\n");
-       mnstr_printf(toConsole, "\\r#     - set maximum rows per page 
(-1=raw)\n");
-       mnstr_printf(toConsole, "\\L file - save client/server interaction\n");
-       mnstr_printf(toConsole, "\\X      - trace mclient code\n");
-       mnstr_printf(toConsole, "\\q      - terminate session\n");
+       mnstr_printf(toConsole, "\\e       - echo the query in sql formatting 
mode\n");
+       mnstr_printf(toConsole, "\\t       - set the timer 
{none,clock,performance} (none is default)\n");
+       mnstr_printf(toConsole, "\\f       - format using a built-in renderer 
{csv,tab,raw,sql,xml,trash,rowcount}\n");
+       mnstr_printf(toConsole, "\\w#      - set maximal page width 
(-1=unlimited, 0=terminal width, >0=limit to num)\n");
+       mnstr_printf(toConsole, "\\r#      - set maximum rows per page 
(-1=raw)\n");
+       mnstr_printf(toConsole, "\\L file  - save client/server interaction\n");
+       mnstr_printf(toConsole, "\\X       - trace mclient code\n");
+       mnstr_printf(toConsole, "\\q       - terminate session\n");
 }
 
 #define MD_TABLE    1
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to