/ Check-in [b8d92d8d]
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:Update the .help screen in the CLI. Make sure the temporary files for ".open" are not deleted too soon.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b8d92d8dc239597c6f01a6e572b047f98ce374a8f48257683fa839dde3ec993f
User & Date: drh 2018-01-11 00:38:39
Context
2018-01-11
13:43
Fix typo in comment. No code changes. check-in: 2c55571b user: drh tags: trunk
00:38
Update the .help screen in the CLI. Make sure the temporary files for ".open" are not deleted too soon. check-in: b8d92d8d user: drh tags: trunk
00:04
Add the built-in edit(VALUE) and edit(VALUE,EDITOR) function to the CLI. check-in: ef823c47 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.in.

  3243   3243     "                         insert   SQL insert statements for TABLE\n"
  3244   3244     "                         line     One value per line\n"
  3245   3245     "                         list     Values delimited by \"|\"\n"
  3246   3246     "                         quote    Escape answers as for SQL\n"
  3247   3247     "                         tabs     Tab-separated values\n"
  3248   3248     "                         tcl      TCL list elements\n"
  3249   3249     ".nullvalue STRING      Use STRING in place of NULL values\n"
  3250         -  ".once FILENAME         Output for the next SQL command only to FILENAME\n"
         3250  +  ".once (-e|-x|FILE)     Output for the next SQL command only to FILE\n"
         3251  +  "                         or invoke system text editor (-e) or spreadsheet (-x)\n"
         3252  +  "                         on the output.\n"
  3251   3253     ".open ?OPTIONS? ?FILE? Close existing database and reopen FILE\n"
  3252   3254     "                         The --new option starts with an empty file\n"
  3253         -  ".output ?FILENAME?     Send output to FILENAME or stdout\n"
         3255  +  ".output ?FILE?         Send output to FILE or stdout\n"
  3254   3256     ".print STRING...       Print literal STRING\n"
  3255   3257     ".prompt MAIN CONTINUE  Replace the standard prompts\n"
  3256   3258     ".quit                  Exit this program\n"
  3257   3259     ".read FILENAME         Execute SQL in FILENAME\n"
  3258   3260     ".restore ?DB? FILE     Restore content of DB (default \"main\") from FILE\n"
  3259   3261     ".save FILE             Write in-memory database into FILE\n"
  3260   3262     ".scanstats on|off      Turn sqlite3_stmt_scanstatus() metrics on or off\n"
................................................................................
  4367   4369   
  4368   4370   /*
  4369   4371   ** Try to delete the temporary file (if there is one) and free the
  4370   4372   ** memory used to hold the name of the temp file.
  4371   4373   */
  4372   4374   static void clearTempFile(ShellState *p){
  4373   4375     if( p->zTempFile==0 ) return;
         4376  +  if( p->doXdgOpen ) return;
  4374   4377     if( shellDeleteFile(p->zTempFile) ) return;
  4375   4378     sqlite3_free(p->zTempFile);
  4376   4379     p->zTempFile = 0;
  4377   4380   }
  4378   4381   
  4379   4382   /*
  4380   4383   ** Create a new temp file name with the given suffix.
................................................................................
  8409   8412     set_table_name(&data, 0);
  8410   8413     if( data.db ){
  8411   8414       session_close_all(&data);
  8412   8415       sqlite3_close(data.db);
  8413   8416     }
  8414   8417     sqlite3_free(data.zFreeOnClose);
  8415   8418     find_home_dir(1);
         8419  +  output_reset(&data);
         8420  +  data.doXdgOpen = 0;
  8416   8421     clearTempFile(&data);
  8417   8422   #if !SQLITE_SHELL_IS_UTF8
  8418   8423     for(i=0; i<argc; i++) sqlite3_free(argv[i]);
  8419   8424     sqlite3_free(argv);
  8420   8425   #endif
  8421   8426     return rc;
  8422   8427   }