From: drh <> Date: Mon, 31 Jan 2022 22:14:53 +0000 (+0000) Subject: CLI: for columnar output modes, make sure the header is not too big. X-Git-Tag: version-3.38.0~71 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=47741b8de9137e552c3a979c5654a15ebcce2d07;p=thirdparty%2Fsqlite.git CLI: for columnar output modes, make sure the header is not too big. Also, improve the help text. FossilOrigin-Name: 070fae3a09cea675e722340870cb2bee9e1ac96954d3baacfdb7f5400ddb1b20 --- diff --git a/manifest b/manifest index 1f7354f999..941a125836 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C CLI:\sFix\sa\sproblem\swith\stabs\sin\sthe\snew\sqbox\smode. -D 2022-01-31T20:39:27.381 +C CLI:\sfor\scolumnar\soutput\smodes,\smake\ssure\sthe\sheader\sis\snot\stoo\sbig.\nAlso,\simprove\sthe\shelp\stext. +D 2022-01-31T22:14:53.379 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -553,7 +553,7 @@ F src/random.c 097dc8b31b8fba5a9aca1697aeb9fd82078ec91be734c16bffda620ced7ab83c F src/resolve.c 24032ae57aec10df2f3fa2e20be0aae7d256bc704124b76c52d763440c7c0fe9 F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92 F src/select.c a6d2d4bed279d7fe4fcedaf297eaf6441e8e17c6e3947a32d24d23be52ac02f2 -F src/shell.c.in 52a69e2611100fbd0cb4adea8d669cb4ae692de2e1ee989eea90b9d2216fc0b7 +F src/shell.c.in 5f848589c29cd03a9ccde31f1507379eb926ff8352a92ecf7ea4baf00823138d F src/sqlite.h.in eaade58049152dac850d57415bcced885ca27ae9582f8aea2cfb7f1db78a521b F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 5d54cf13d3406d8eb65d921a0d3c349de6126b732e695e79ecd4830ce86b4f8a @@ -1942,8 +1942,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 3ec6141c41a71eea0d96a65aa35c828e4d852d60e090513c312b925d0e257f9a -R 653501eaadaf515fee417911e957f02f +P ca96ab3ef78479d95e831cacdb80f23c119cbaa77b3821eac7a3f110bfe20cc9 +R 7edb6446ecfd92c5152a5ff12c329ed4 U drh -Z 96fbc4796acfbba99607741d48514123 +Z ad9f462a73710576b722f55f5a4feb61 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 1a434190f8..9706a31c8a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ca96ab3ef78479d95e831cacdb80f23c119cbaa77b3821eac7a3f110bfe20cc9 \ No newline at end of file +070fae3a09cea675e722340870cb2bee9e1ac96954d3baacfdb7f5400ddb1b20 \ No newline at end of file diff --git a/src/shell.c.in b/src/shell.c.in index d44048aa3f..f412f345d9 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -3333,7 +3333,12 @@ static void exec_prepared_stmt_columnar( p->actualWidth[i] = w; } for(i=0; icolWidth[i]; + if( wx==0 ) wx = p->iWrap; + if( wx<0 ) wx = -wx; + uz = (const unsigned char*)sqlite3_column_name(pStmt,i); + azData[i] = translateForDisplayAndDup(uz, &zNotUsed, wx); } do{ int useNextLine = bNextLine; @@ -3350,6 +3355,7 @@ static void exec_prepared_stmt_columnar( for(i=0; icolWidth[i]; if( wx==0 ) wx = p->iWrap; + if( wx<0 ) wx = -wx; if( useNextLine ){ uz = azNextLine[i]; }else if( p->bQuote ){ @@ -4257,7 +4263,7 @@ static const char *(azHelp[]) = { ".load FILE ?ENTRY? Load an extension library", #endif ".log FILE|off Turn logging on or off. FILE can be stderr/stdout", - ".mode MODE ?TABLE? ?OPTIONS? Set output mode", + ".mode MODE ?OPTIONS? Set output mode", " MODE is one of:", " ascii Columns/rows delimited by 0x1F and 0x1E", " box Tables using unicode box-drawing characters", @@ -4278,6 +4284,7 @@ static const char *(azHelp[]) = { " --wrap N Wrap output lines longer than N character", " --quote Quote output text as SQL literals", " --noquote Do not quote output text", + " TABLE The name of SQL table used for \"insert\" mode", ".nonce STRING Disable safe mode for one command if the nonce matches", ".nullvalue STRING Use STRING in place of NULL values", ".once ?OPTIONS? ?FILE? Output for the next SQL command only to FILE",