diff options
author | drh <drh@noemail.net> | 2002-06-25 19:31:18 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2002-06-25 19:31:18 +0000 |
commit | 411995dc0d1611c8aa2a00c48d0c9cf756a34d98 (patch) | |
tree | acc44ba6a738483663ba7552cfab191af4a10ab7 /src/shell.c | |
parent | e3c163e4e0dcde351a1cebd88b890ade51cfa9b7 (diff) | |
download | sqlite-411995dc0d1611c8aa2a00c48d0c9cf756a34d98.tar.gz sqlite-411995dc0d1611c8aa2a00c48d0c9cf756a34d98.zip |
Add the sqlite_open_aux_file() API. (CVS 646)
FossilOrigin-Name: 332164d6455658ca633a1dc49811d9fb0fd4b01c
Diffstat (limited to 'src/shell.c')
-rw-r--r-- | src/shell.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/shell.c b/src/shell.c index d8ee2108e..a3c94bf67 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.58 2002/06/25 01:09:12 drh Exp $ +** $Id: shell.c,v 1.59 2002/06/25 19:31:18 drh Exp $ */ #include <stdlib.h> #include <string.h> @@ -486,6 +486,7 @@ static char zHelp[] = " \"insert\", \"list\", or \"html\"\n" ".mode insert TABLE Generate SQL insert statements for TABLE\n" ".nullvalue STRING Print STRING instead of nothing for NULL data\n" + ".openaux FILENAME Use FILENAME to hold TEMP tables\n" ".output FILENAME Send output to FILENAME\n" ".output stdout Send output to the screen\n" ".prompt MAIN CONTINUE Replace the standard prompts\n" @@ -702,6 +703,15 @@ static int do_meta_command(char *zLine, sqlite *db, struct callback_data *p){ sprintf(p->nullvalue, "%.*s", (int)ArraySize(p->nullvalue)-1, azArg[1]); }else + if( c=='o' && strncmp(azArg[0], "openaux", n)==0 ){ + char *zErrMsg = 0; + sqlite_open_aux_file(db, nArg>=2 ? azArg[1] : 0, &zErrMsg); + if( zErrMsg ){ + fprintf(stderr,"Error: %s\n", zErrMsg); + free(zErrMsg); + } + }else + if( c=='o' && strncmp(azArg[0], "output", n)==0 && nArg==2 ){ if( p->out!=stdout ){ fclose(p->out); |