aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2023-08-14 13:33:19 +0000
committerdrh <>2023-08-14 13:33:19 +0000
commit1f72b53461534a5038f8caedeaf475024b29c2d2 (patch)
tree36ab2c23d91ceac03e68b606ce2fe283ba4f8577 /src
parent592ae2823cfaa0a1b56b782aa45201c5618171c2 (diff)
downloadsqlite-1f72b53461534a5038f8caedeaf475024b29c2d2.tar.gz
sqlite-1f72b53461534a5038f8caedeaf475024b29c2d2.zip
Change the name of the ".binary" command in the CLI to ".crnl". The sense of
the setting is inverted. The original ".binary" still works for backwards compatibility but is now undocumented. ".crnl" is also undocumented on machines where it is a no-op (all machines other than Windows). [forum:/forumpost/8bd0b0fbdbc12477|forum thread 8bd0b0fbdbc12477] FossilOrigin-Name: 544de2da09cd7b9bbb6cb4c52bb22325ace3391fca00c6a43847bfc158032b66
Diffstat (limited to 'src')
-rw-r--r--src/shell.c.in23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/shell.c.in b/src/shell.c.in
index 1e65d0e9f..55a13bc11 100644
--- a/src/shell.c.in
+++ b/src/shell.c.in
@@ -4799,7 +4799,6 @@ static const char *(azHelp[]) = {
" --async Write to FILE without journal and fsync()",
#endif
".bail on|off Stop after hitting an error. Default OFF",
- ".binary on|off Turn binary output on or off. Default OFF",
#ifndef SQLITE_SHELL_FIDDLE
".cd DIRECTORY Change the working directory to DIRECTORY",
#endif
@@ -4809,6 +4808,9 @@ static const char *(azHelp[]) = {
".clone NEWDB Clone data into NEWDB from the existing database",
#endif
".connection [close] [#] Open or close an auxiliary database connection",
+#if defined(_WIN32) || defined(WIN32)
+ ".crnl on|off Turn translate \\n to \\r\\n. Default ON",
+#endif
".databases List names and files of attached databases",
".dbconfig ?op? ?val? List or change sqlite3_db_config() options",
#if SQLITE_SHELL_HAVE_RECOVER
@@ -8164,6 +8166,7 @@ static int do_meta_command(char *zLine, ShellState *p){
}
}else
+ /* Undocumented. Legacy only. See "crnl" below */
if( c=='b' && n>=3 && cli_strncmp(azArg[0], "binary", n)==0 ){
if( nArg==2 ){
if( booleanValue(azArg[1]) ){
@@ -8172,6 +8175,8 @@ static int do_meta_command(char *zLine, ShellState *p){
setTextMode(p->out, 1);
}
}else{
+ raw_printf(stderr, "The \".binary\" command is deprecated."
+ " Use \".crnl\" instead.\n");
raw_printf(stderr, "Usage: .binary on|off\n");
rc = 1;
}
@@ -8299,6 +8304,22 @@ static int do_meta_command(char *zLine, ShellState *p){
}
}else
+ if( c=='c' && n==4 && cli_strncmp(azArg[0], "crnl", n)==0 ){
+ if( nArg==2 ){
+ if( booleanValue(azArg[1]) ){
+ setTextMode(p->out, 1);
+ }else{
+ setBinaryMode(p->out, 1);
+ }
+ }else{
+#if !defined(_WIN32) && !defined(WIN32)
+ raw_printf(stderr, "The \".crnl\" is a no-op on non-Windows machines.\n");
+#endif
+ raw_printf(stderr, "Usage: .crnl on|off\n");
+ rc = 1;
+ }
+ }else
+
if( c=='d' && n>1 && cli_strncmp(azArg[0], "databases", n)==0 ){
char **azName = 0;
int nName = 0;