From 6ff13859d57c0e83194b88a46b096cf7af1d8557 Mon Sep 17 00:00:00 2001 From: drh Date: Sun, 25 Nov 2001 13:18:23 +0000 Subject: [PATCH] Add the ability to do a single .command as the second argument to the command-line shell. (CVS 321) FossilOrigin-Name: 653f37c365a0b5d59c11b7dbba57905ffaeff2dc --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/shell.c | 15 +++++++++++---- www/changes.tcl | 5 +++++ 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index 6490a2f45a..d443649930 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stypos.\s(CVS\s320) -D 2001-11-24T13:50:53 +C Add\sthe\sability\sto\sdo\sa\ssingle\s.command\sas\sthe\ssecond\sargument\nto\sthe\scommand-line\sshell.\s(CVS\s321) +D 2001-11-25T13:18:24 F Makefile.in 352fed589f09dd94347e0bb391d047118ebd6105 F Makefile.template b6c3d3ba089e97e3a721e967f3151350f36cb42b F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0 @@ -37,7 +37,7 @@ F src/parse.y 5295f393f41ea89958287e5738e6c12c7cd67482 F src/printf.c 300a90554345751f26e1fc0c0333b90a66110a1d F src/random.c 2a9cc2c9716d14815fd4c2accf89d87a1143e46b F src/select.c fa1c7144a9ad7ce3f16373b443bc25e764af4be7 -F src/shell.c 175f4e942286bcafefc5bd44346deb94394615b1 +F src/shell.c 407095aaeeae78f42deb3e846b1ad77f8ed3b4ef F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e F src/sqlite.h.in 934de9112747ad8d8e7d5fec44876246b24ca5a3 F src/sqliteInt.h 1d812fd1eed0008d31f7e31293f058bb6dbe3f09 @@ -104,7 +104,7 @@ F www/arch.fig d5f9752a4dbf242e9cfffffd3f5762b6c63b3bcf F www/arch.png 82ef36db1143828a7abc88b1e308a5f55d4336f4 F www/arch.tcl 72a0c80e9054cc7025a50928d28d9c75c02c2b8b F www/c_interface.tcl 58922228e8fdb0f6af3561a051ee8ccec6dbfd17 -F www/changes.tcl 0a54872839461f49b7300b36571d342f0ef0d4fb +F www/changes.tcl 6aa1912a7da010dee96b904bbf74694eb4d4445c F www/crosscompile.tcl 3622ebbe518927a3854a12de51344673eb2dd060 F www/download.tcl 1ea61f9d89a2a5a9b2cee36b0d5cf97321bdefe0 F www/dynload.tcl 02eb8273aa78cfa9070dd4501dca937fb22b466c @@ -117,7 +117,7 @@ F www/speed.tcl 83457b2bf6bb430900bd48ca3dd98264d9a916a5 F www/sqlite.tcl 8b5884354cb615049aed83039f8dfe1552a44279 F www/tclsqlite.tcl 880ef67cb4f2797b95bf1368fc4e0d8ca0fda956 F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218 -P e86a68c5ace984da09d3ce44dae5d501ec0d0eec -R 71292e19ac500e514794999bf8339d1a +P 3be8a189e8ccf8a82acc4ee72cc75b6cc92aa193 +R bef40867b94c97a0a18ccef8081a3db9 U drh -Z 219866e6286d486743b9a8447e369653 +Z c7c502054afc4f55970b082ddb69834b diff --git a/manifest.uuid b/manifest.uuid index b8b9652715..70e8b599b1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3be8a189e8ccf8a82acc4ee72cc75b6cc92aa193 \ No newline at end of file +653f37c365a0b5d59c11b7dbba57905ffaeff2dc \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 4db83d7b77..0f4464824b 100644 --- a/src/shell.c +++ b/src/shell.c @@ -12,7 +12,7 @@ ** This file contains code to implement the "sqlite" command line ** utility for accessing SQLite databases. ** -** $Id: shell.c,v 1.39 2001/11/24 00:31:46 drh Exp $ +** $Id: shell.c,v 1.40 2001/11/25 13:18:24 drh Exp $ */ #include #include @@ -907,9 +907,16 @@ int main(int argc, char **argv){ } data.out = stdout; if( argc==3 ){ - if( sqlite_exec(db, argv[2], callback, &data, &zErrMsg)!=0 && zErrMsg!=0 ){ - fprintf(stderr,"SQL error: %s\n", zErrMsg); - exit(1); + if( argv[2][0]=='.' ){ + do_meta_command(argv[2], db, &data); + exit(0); + }else{ + int rc; + rc = sqlite_exec(db, argv[2], callback, &data, &zErrMsg); + if( rc!=0 && zErrMsg!=0 ){ + fprintf(stderr,"SQL error: %s\n", zErrMsg); + exit(1); + } } }else{ extern int isatty(); diff --git a/www/changes.tcl b/www/changes.tcl index c76ad91bcd..ff464d4f42 100644 --- a/www/changes.tcl +++ b/www/changes.tcl @@ -17,6 +17,11 @@ proc chng {date desc} { puts "

    $desc

" } +chng {2001 Nov ?? (2.1.4)} { +
  • Add the ability to put a single .command in the second argument + of the sqlite shell
  • +} + chng {2001 Nov 23 (2.1.3)} {
  • Fix the behavior of comparison operators (ex: "<", "==", etc.)