/ Check-in [58f02e6e]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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".
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 58f02e6eae8fc9e2577fe435b0282fb46af3960d
User & Date: drh 2017-01-27 01:52:42
Context
2017-01-27
13:14
Alternative ICU fix (compare to check-in [50e60cb4]) that avoids casting integers to pointers. check-in: d9752c8f user: drh tags: trunk
01:52
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". check-in: 58f02e6e user: drh tags: trunk
01:25
Another micro-optimization in accessPayload(). Slightly smaller and faster. check-in: c012619b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

  4284   4284   
  4285   4285     if( c=='m' && strncmp(azArg[0], "mode", n)==0 ){
  4286   4286       const char *zMode = nArg>=2 ? azArg[1] : "";
  4287   4287       int n2 = (int)strlen(zMode);
  4288   4288       int c2 = zMode[0];
  4289   4289       if( c2=='l' && n2>2 && strncmp(azArg[1],"lines",n2)==0 ){
  4290   4290         p->mode = MODE_Line;
         4291  +      sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
  4291   4292       }else if( c2=='c' && strncmp(azArg[1],"columns",n2)==0 ){
  4292   4293         p->mode = MODE_Column;
         4294  +      sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
  4293   4295       }else if( c2=='l' && n2>2 && strncmp(azArg[1],"list",n2)==0 ){
  4294   4296         p->mode = MODE_List;
         4297  +      sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Column);
         4298  +      sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
  4295   4299       }else if( c2=='h' && strncmp(azArg[1],"html",n2)==0 ){
  4296   4300         p->mode = MODE_Html;
  4297   4301       }else if( c2=='t' && strncmp(azArg[1],"tcl",n2)==0 ){
  4298   4302         p->mode = MODE_Tcl;
  4299   4303         sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Space);
         4304  +      sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
  4300   4305       }else if( c2=='c' && strncmp(azArg[1],"csv",n2)==0 ){
  4301   4306         p->mode = MODE_Csv;
  4302   4307         sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Comma);
  4303   4308         sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_CrLf);
  4304   4309       }else if( c2=='t' && strncmp(azArg[1],"tabs",n2)==0 ){
  4305   4310         p->mode = MODE_List;
  4306   4311         sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Tab);