From: drh Date: Fri, 27 Jan 2017 01:52:42 +0000 (+0000) Subject: In the command-line shell, enhance the ".mode" command so that it restores the X-Git-Tag: version-3.17.0~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7aee83b935ccdd9031ffc2e4ab599cd8f5656981;p=thirdparty%2Fsqlite.git In the command-line shell, enhance the ".mode" command so that it restores the default column and row separators for modes "line", "list", "column", and "tcl". FossilOrigin-Name: 58f02e6eae8fc9e2577fe435b0282fb46af3960d --- diff --git a/manifest b/manifest index f94e40935d..24e35fa9c7 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Another\smicro-optimization\sin\saccessPayload().\s\sSlightly\ssmaller\sand\sfaster. -D 2017-01-27T01:25:00.940 +C In\sthe\scommand-line\sshell,\senhance\sthe\s".mode"\scommand\sso\sthat\sit\srestores\sthe\ndefault\scolumn\sand\srow\sseparators\sfor\smodes\s"line",\s"list",\s"column",\sand\n"tcl". +D 2017-01-27T01:52:42.481 F Makefile.in 5f415e7867296d678fed2e6779aea10c1318b4bc F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da @@ -391,7 +391,7 @@ F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384 F src/resolve.c f9bc0de45a30a450da47b3766de00be89bf9be79 F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac F src/select.c 3856db523b942062bca8722ba03b61c324ff94d6 -F src/shell.c 59de9acab4423a536277653f2a9dcdd1307989f3 +F src/shell.c a84e453c213f3e0d6935a582024da4e242f85a19 F src/sqlite.h.in 1971ab9709e010d52a02a1a6276d5a2f9b947476 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 8648034aa702469afb553231677306cc6492a1ae @@ -1547,7 +1547,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P ebb1fd98d4e448aa6d8f1e5be7ddc5bedb3db95b -R 63992a28f021aa7b8223daa601910fb3 +P c012619b65d70b4ef6cf33532ef57d7f8ba42d74 +R dc9b2fbf482ea9dbd0fd27947b6ee819 U drh -Z 78e3ca04c2459249956256691b4d7091 +Z 49761a5cfc1a2c7c58e7f0cde30087c6 diff --git a/manifest.uuid b/manifest.uuid index 23c39251fa..beee9d8c88 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c012619b65d70b4ef6cf33532ef57d7f8ba42d74 \ No newline at end of file +58f02e6eae8fc9e2577fe435b0282fb46af3960d \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index db4362dd32..0e553d9fbb 100644 --- a/src/shell.c +++ b/src/shell.c @@ -4288,15 +4288,20 @@ static int do_meta_command(char *zLine, ShellState *p){ int c2 = zMode[0]; if( c2=='l' && n2>2 && strncmp(azArg[1],"lines",n2)==0 ){ p->mode = MODE_Line; + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); }else if( c2=='c' && strncmp(azArg[1],"columns",n2)==0 ){ p->mode = MODE_Column; + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); }else if( c2=='l' && n2>2 && strncmp(azArg[1],"list",n2)==0 ){ p->mode = MODE_List; + sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Column); + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); }else if( c2=='h' && strncmp(azArg[1],"html",n2)==0 ){ p->mode = MODE_Html; }else if( c2=='t' && strncmp(azArg[1],"tcl",n2)==0 ){ p->mode = MODE_Tcl; sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Space); + sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row); }else if( c2=='c' && strncmp(azArg[1],"csv",n2)==0 ){ p->mode = MODE_Csv; sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Comma);