1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Add the ability to do a single .command as the second argument

to the command-line shell. (CVS 321)

FossilOrigin-Name: 653f37c365a0b5d59c11b7dbba57905ffaeff2dc
This commit is contained in:
drh
2001-11-25 13:18:23 +00:00
parent e68fefdaa5
commit 6ff13859d5
4 changed files with 24 additions and 12 deletions

View File

@ -1,5 +1,5 @@
C Fix\stypos.\s(CVS\s320) 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-24T13:50:53 D 2001-11-25T13:18:24
F Makefile.in 352fed589f09dd94347e0bb391d047118ebd6105 F Makefile.in 352fed589f09dd94347e0bb391d047118ebd6105
F Makefile.template b6c3d3ba089e97e3a721e967f3151350f36cb42b F Makefile.template b6c3d3ba089e97e3a721e967f3151350f36cb42b
F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0 F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0
@ -37,7 +37,7 @@ F src/parse.y 5295f393f41ea89958287e5738e6c12c7cd67482
F src/printf.c 300a90554345751f26e1fc0c0333b90a66110a1d F src/printf.c 300a90554345751f26e1fc0c0333b90a66110a1d
F src/random.c 2a9cc2c9716d14815fd4c2accf89d87a1143e46b F src/random.c 2a9cc2c9716d14815fd4c2accf89d87a1143e46b
F src/select.c fa1c7144a9ad7ce3f16373b443bc25e764af4be7 F src/select.c fa1c7144a9ad7ce3f16373b443bc25e764af4be7
F src/shell.c 175f4e942286bcafefc5bd44346deb94394615b1 F src/shell.c 407095aaeeae78f42deb3e846b1ad77f8ed3b4ef
F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
F src/sqlite.h.in 934de9112747ad8d8e7d5fec44876246b24ca5a3 F src/sqlite.h.in 934de9112747ad8d8e7d5fec44876246b24ca5a3
F src/sqliteInt.h 1d812fd1eed0008d31f7e31293f058bb6dbe3f09 F src/sqliteInt.h 1d812fd1eed0008d31f7e31293f058bb6dbe3f09
@ -104,7 +104,7 @@ F www/arch.fig d5f9752a4dbf242e9cfffffd3f5762b6c63b3bcf
F www/arch.png 82ef36db1143828a7abc88b1e308a5f55d4336f4 F www/arch.png 82ef36db1143828a7abc88b1e308a5f55d4336f4
F www/arch.tcl 72a0c80e9054cc7025a50928d28d9c75c02c2b8b F www/arch.tcl 72a0c80e9054cc7025a50928d28d9c75c02c2b8b
F www/c_interface.tcl 58922228e8fdb0f6af3561a051ee8ccec6dbfd17 F www/c_interface.tcl 58922228e8fdb0f6af3561a051ee8ccec6dbfd17
F www/changes.tcl 0a54872839461f49b7300b36571d342f0ef0d4fb F www/changes.tcl 6aa1912a7da010dee96b904bbf74694eb4d4445c
F www/crosscompile.tcl 3622ebbe518927a3854a12de51344673eb2dd060 F www/crosscompile.tcl 3622ebbe518927a3854a12de51344673eb2dd060
F www/download.tcl 1ea61f9d89a2a5a9b2cee36b0d5cf97321bdefe0 F www/download.tcl 1ea61f9d89a2a5a9b2cee36b0d5cf97321bdefe0
F www/dynload.tcl 02eb8273aa78cfa9070dd4501dca937fb22b466c F www/dynload.tcl 02eb8273aa78cfa9070dd4501dca937fb22b466c
@ -117,7 +117,7 @@ F www/speed.tcl 83457b2bf6bb430900bd48ca3dd98264d9a916a5
F www/sqlite.tcl 8b5884354cb615049aed83039f8dfe1552a44279 F www/sqlite.tcl 8b5884354cb615049aed83039f8dfe1552a44279
F www/tclsqlite.tcl 880ef67cb4f2797b95bf1368fc4e0d8ca0fda956 F www/tclsqlite.tcl 880ef67cb4f2797b95bf1368fc4e0d8ca0fda956
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218 F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
P e86a68c5ace984da09d3ce44dae5d501ec0d0eec P 3be8a189e8ccf8a82acc4ee72cc75b6cc92aa193
R 71292e19ac500e514794999bf8339d1a R bef40867b94c97a0a18ccef8081a3db9
U drh U drh
Z 219866e6286d486743b9a8447e369653 Z c7c502054afc4f55970b082ddb69834b

View File

@ -1 +1 @@
3be8a189e8ccf8a82acc4ee72cc75b6cc92aa193 653f37c365a0b5d59c11b7dbba57905ffaeff2dc

View File

@ -12,7 +12,7 @@
** This file contains code to implement the "sqlite" command line ** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases. ** 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 <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -907,9 +907,16 @@ int main(int argc, char **argv){
} }
data.out = stdout; data.out = stdout;
if( argc==3 ){ if( argc==3 ){
if( sqlite_exec(db, argv[2], callback, &data, &zErrMsg)!=0 && zErrMsg!=0 ){ if( argv[2][0]=='.' ){
fprintf(stderr,"SQL error: %s\n", zErrMsg); do_meta_command(argv[2], db, &data);
exit(1); 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{ }else{
extern int isatty(); extern int isatty();

View File

@ -17,6 +17,11 @@ proc chng {date desc} {
puts "<DD><P><UL>$desc</UL></P></DD>" puts "<DD><P><UL>$desc</UL></P></DD>"
} }
chng {2001 Nov ?? (2.1.4)} {
<li>Add the ability to put a single .command in the second argument
of the sqlite shell</li>
}
chng {2001 Nov 23 (2.1.3)} { chng {2001 Nov 23 (2.1.3)} {
<li>Fix the behavior of comparison operators <li>Fix the behavior of comparison operators
(ex: "<b>&lt</b>", "<b>==</b>", etc.) (ex: "<b>&lt</b>", "<b>==</b>", etc.)