-C new\ssection\sfor\skeywords,\smore\sdocs\sfor\sattached\sdatabases\s,\slinks,\scleanup\s(CVS\s952)
-D 2003-05-04T07:02:55
+C added\sshell\scommand\s".databases"\sto\slist\sname\sand\sfile\sof\sopen\sones.\s(CVS\s953)
+D 2003-05-04T07:25:58
F Makefile.in 004acec253ecdde985c8ecd5b7c9accdb210378f
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
F src/printf.c fc5fdef6e92ad205005263661fe9716f55a49f3e
F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe
F src/select.c 3fe63e3a29df661ba72a67eecd77e8ee82801def
-F src/shell.c 6f59240f69e65a1c4e1d06492eb9238092defc34
+F src/shell.c c53ff468787109cf178c6b14ecb7a78654018fd1
F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
F src/sqlite.h.in eec06462cba262c0ee03f38462a18a4bc66dda4e
F src/sqliteInt.h a3d84942dacaf72fbe1426adfbd37e8cf5f57e97
F www/sqlite.tcl ae3dcfb077e53833b59d4fcc94d8a12c50a44098
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
-P 24b9b569240d2108b17420d85cafdc718c67269f
-R f59caf097b77c12dfe5196947fa850d1
+P 87e1b6a936972670771cf90670aeb4308ba0a30a
+R 5320898e74f5e804dcf5efe20f5cd8de
U jplyon
-Z 15d8de3d7ad598167e85986bd9fd5378
+Z 6095dc4d8b2b48d4029c4d0dd1f58135
-87e1b6a936972670771cf90670aeb4308ba0a30a
\ No newline at end of file
+741a5a8d3975fb5db18914b7879b12aead59279b
\ No newline at end of file
** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases.
**
-** $Id: shell.c,v 1.75 2003/04/30 11:38:26 drh Exp $
+** $Id: shell.c,v 1.76 2003/05/04 07:25:58 jplyon Exp $
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "sqlite.h"
+#include "sqliteInt.h"
#include <ctype.h>
#if !defined(_WIN32) && !defined(WIN32) && !defined(__MACOS__)
** Text of a help message
*/
static char zHelp[] =
- ".dump ?TABLE? ... Dump the database in an text format\n"
+ ".databases List names and files of attached databases\n"
+ ".dump ?TABLE? ... Dump the database in a text format\n"
".echo ON|OFF Turn command echo on or off\n"
".exit Exit this program\n"
".explain ON|OFF Turn output mode suitable for EXPLAIN on or off.\n"
if( nArg==0 ) return rc;
n = strlen(azArg[0]);
c = azArg[0][0];
+ if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){
+ int i;
+ open_db(p);
+ fprintf(p->out, "[Name]\t[File]\n");
+ for(i=0; i<db->nDb; i++){
+ sqlite *db = p->db;
+ Db *pDb = &db->aDb[i];
+ BtOps* pOps = btOps(pDb->pBt);
+ const char *zName = pDb->zName;
+ const char *zFilename = pOps->GetFilename(pDb->pBt);
+ fprintf(p->out, "%s\t%s\n", zName, zFilename);
+ }
+ }else
+
if( c=='d' && strncmp(azArg[0], "dump", n)==0 ){
char *zErrMsg = 0;
open_db(p);