Add the ".save" command as an alias for ".backup". Improvements to the

way font changes are implemented on the in-memory database warning.

FossilOrigin-Name: fe284afe739c497e153ac2bc0275f7c9e862c824
This commit is contained in:
drh 2014-02-10 19:59:27 +00:00
parent ba47ba76a5
commit 5c7976fe86
3 changed files with 25 additions and 27 deletions

View File

@ -1,5 +1,5 @@
C On\sunix,\smake\sthe\s"transient\sin-memory\sdatabase"\stext\sbold,\sbut\snot\sred.\nLeave\sthe\stext\sread\son\swindows.
D 2014-02-10T19:36:06.410
C Add\sthe\s".save"\scommand\sas\san\salias\sfor\s".backup".\s\sImprovements\sto\sthe\nway\sfont\schanges\sare\simplemented\son\sthe\sin-memory\sdatabase\swarning.
D 2014-02-10T19:59:27.437
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -220,7 +220,7 @@ F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece
F src/resolve.c 7eda9097b29fcf3d2b42fdc17d1de672134e09b6
F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0
F src/select.c c055a9fa25a4e7fc8c1652c44a31d6382dbb1e8a
F src/shell.c 8b549f83209f8b1df9490c9f50116a0c8ac4cae5
F src/shell.c cb8d19594483d23d6e35244bb043cf0cd1816a52
F src/sqlite.h.in eed7f7d66a60daaa7b4a597dcd9bad87aad9611b
F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e
F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc
@ -1152,7 +1152,7 @@ F tool/vdbe-compress.tcl 0cf56e9263a152b84da86e75a5c0cdcdb7a47891
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
P 0fbc0fcec1b3a67065fa0ebb49375bf675789edc
R 1d621b0234ebbbe4535aa1198b61b626
P c9eba2f7be468ae7fc843ffd5b09bd062ee311c3
R 5e3b4e27dbbde8802d4b99c9e620e482
U drh
Z 2f66f19a9b47ffbd33cb1946222fcf2d
Z be8b5d9bf50fdc639aa9aecf25f98639

View File

@ -1 +1 @@
c9eba2f7be468ae7fc843ffd5b09bd062ee311c3
fe284afe739c497e153ac2bc0275f7c9e862c824

View File

@ -1583,6 +1583,7 @@ static char zHelp[] =
".quit Exit this program\n"
".read FILENAME Execute SQL in FILENAME\n"
".restore ?DB? FILE Restore content of DB (default \"main\") from FILE\n"
".save FILE Write in-memory database into FILE\n"
".schema ?TABLE? Show the CREATE statements\n"
" If TABLE specified, only show tables matching\n"
" LIKE pattern TABLE.\n"
@ -2152,7 +2153,9 @@ static int do_meta_command(char *zLine, struct callback_data *p){
if( nArg==0 ) return 0; /* no tokens, no error */
n = strlen30(azArg[0]);
c = azArg[0][0];
if( c=='b' && n>=3 && strncmp(azArg[0], "backup", n)==0 ){
if( (c=='b' && n>=3 && strncmp(azArg[0], "backup", n)==0)
|| (c=='s' && n>=3 && strncmp(azArg[0], "save", n)==0)
){
const char *zDestFile = 0;
const char *zDb = 0;
sqlite3 *pDest;
@ -3501,25 +3504,22 @@ static void main_init(struct callback_data *data) {
}
/*
** Arrange for subsequent text console output to be RED or normal. Use
** the SetConsoleTextAttribute() function on windows. On all other
** platforms, assume VT100 escape sequences are recognized.
** Output text to the console in a font that attracts extra attention.
*/
#ifdef _WIN32
static void outputRed(void){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
FOREGROUND_RED|FOREGROUND_INTENSITY);
}
static void outputNormal(void){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
static void printBold(const char *zText){
HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO defaultScreenInfo;
GetConsoleScreenBufferInfo(out, &defaultScreenInfo);
SetConsoleTextAttribute(out,
FOREGROUND_RED|FOREGROUND_INTENSITY
);
printf("%s", zText);
SetConsoleTextAttribute(out, defaultScreenInfo.wAttributes);
}
#else
static void outputRed(void){
printf("\033[1m");
}
static void outputNormal(void){
printf("\033[0m");
static void printBold(const char *zText){
printf("\033[1m%s\033[0m", zText);
}
#endif
@ -3780,10 +3780,8 @@ int main(int argc, char **argv){
);
if( warnInmemoryDb ){
printf("Connected to a ");
outputRed();
printf("transient in-memory database");
outputNormal();
printf(".\nUse \".open FILENAME\" to reopen on a "
printBold("transient in-memory database.");
printf("\nUse \".open FILENAME\" to reopen on a "
"persistent database.\n");
}
zHome = find_home_dir();