-C Doc\stypo\sfix.
-D 2025-11-24T13:22:26.057
+C In\sthe\sCLI\son\sthe\s".mode"\scommand,\sreplace\sthe\srecently\sadded\s--no-limits\soption\swith\n"--limits\sL,C".\s\sAnd\sadd\s--sw\sas\san\salias\sfor\s--screenwidth.
+D 2025-11-24T13:24:58.335
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F src/resolve.c 5616fbcf3b833c7c705b24371828215ad0925d0c0073216c4f153348d5753f0a
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
F src/select.c ba9cd07ffa3277883c1986085f6ddc4320f4d35d5f212ab58df79a7ecc1a576a
-F src/shell.c.in 7f4a56ac62b5030755e72c5a9598b45782a0deccba350605b13d6d7b48e58b2d
+F src/shell.c.in bc2185e0e988f93643dbaac3c8f190b3687475cd7ac802c035d20347b8e27fbb
F src/sqlite.h.in f1363321ca55cc2feaa289e9fe6dfb08102a28c54edf005564711a2348b06eef
F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
F src/sqlite3ext.h 5d5330f5f8461f5ce74960436ddcfa53ecd09c2b8b23901e22ae38aec3243998
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 526b88fb9b270e780660b97fc14f41583885a3d801f0ed17e0e35ebd61749b26
-R 303b989f731f7a72bc186051f75f7c2a
-U stephan
-Z f553d8b6235263e64ab21b35c8f6d005
+P d96cc772f0423f3f2b6ee0b0fb3d7e133cc4981cc7be76527a6d43792ece74e2
+Q +caefe4c746599b22aec446f3aeb296e53edaf8c54f8ae803381e8c21d5e29ab4
+R d3f9408cc4e0564645dc312501bb3665
+U drh
+Z 7aa8998c4c3a9b227543e2da76143342
# Remove this line to create a well-formed Fossil manifest.
**
** USAGE: .mode [MODE] [OPTIONS]
**
-** Change the output mode to MODE and/or apply OPTIONS to the
-** output mode. If no arguments, show the current output mode
-** and relevant options.
+** Change the output mode to MODE and/or apply OPTIONS to the output mode.
+** Arguments are processed from left to right. If no arguments, show the
+** current output mode and relevant options.
**
** Options:
** --align STRING Set the alignment of text in columnar modes
** any single SQL value to N. Longer values are
** truncated. Zero means "no limit". Only works
** in "line" mode and in columnar modes.
+** --limits L,C Shorthand for "--linelimit L --charlimit C".
+** Or "off" to mean "0,0". Or "on" for "5,300".
** --list List available modes
-** --no-limits Shorthand to turn off --linelimit, --charlimit,
-** and --screenwidth.
** --null STRING Render SQL NULL values as the given string
** --once Setting changes to the right are reverted after
** the next SQL command.
** "on and "sql" are synonyms.
** --reset Changes all mode settings back to their default.
** --rowsep STRING Use STRING as the row separator
-** --screenwidth N Declare the screen width of the output device
+** --sw|--screenwidth N Declare the screen width of the output device
** to be N characters. An attempt may be made to
** wrap output text to fit within this limit. Zero
** means "no limit". Or N can be "auto" to set the
** --tablename NAME Set the name of the table for "insert" mode.
** --tag NAME Save mode to the left as NAME.
** --textjsonb BOOLEAN If enabled, JSONB text is displayed as text JSON.
-** --title ARG Whether or not to show column headers, and if so
+** --title ARG Whether or not to show column headers, and if so
** how to encode them. ARG can be "off", "on",
** "sql", "csv", "html", "tcl", or "json".
** -v|--verbose Verbose output
}else if( optionMatch(z,"escape") ){
/* See similar code at tag-20250224-1 */
char *zErr = 0;
- if( i+1>=nArg ){
- dotCmdError(p, i, "missing argument", 0);
+ if( (++i)>=nArg ){
+ dotCmdError(p, i-1, "missing argument", 0);
return 1;
- }
- i++; /* 0 1 2 <-- One less than QRF_ESC_ */
+ } /* 0 1 2 <-- One less than QRF_ESC_ */
k = pickStr(azArg[i],&zErr,"off","ascii","symbol","");
if( k<0 ){
dotCmdError(p, i, "unknown escape type", "%s", zErr);
}
p->mode.spec.eEsc = k+1;
chng = 1;
+ }else if( optionMatch(z,"limits") ){
+ if( (++i)>=nArg ){
+ dotCmdError(p, i-1, "missing argument", 0);
+ return 1;
+ }
+ k = pickStr(azArg[i],0,"on","off","");
+ if( k==0 ){
+ p->mode.spec.nLineLimit = 5;
+ p->mode.spec.nCharLimit = 300;
+ }else if( k==1 ){
+ p->mode.spec.nLineLimit = 0;
+ p->mode.spec.nCharLimit = 0;
+ }else{
+ int L, C;
+ int nNum = sscanf(azArg[i], "%d,%d", &L, &C);
+ if( nNum!=2 || L<0 || C<0 ){
+ dotCmdError(p, i, "bad argument", "Should be \"L,C\" where L and C"
+ " are unsigned integers");
+ return 1;
+ }
+ p->mode.spec.nLineLimit = L;
+ p->mode.spec.nCharLimit = C;
+ }
+ chng = 1;
}else if( optionMatch(z,"list") ){
int ii;
cli_puts("available modes:", p->out);
p->mode.spec.eText = QRF_TEXT_Plain;
p->mode.spec.eBlob = QRF_BLOB_Text;
chng = 1;
- }else if( optionMatch(z,"no-limits") ){
- p->mode.spec.nLineLimit = 0;
- p->mode.spec.nCharLimit = 0;
- p->mode.spec.nScreenWidth = 0;
- p->mode.bAutoScreenWidth = 0;
- chng = 1;
}else if( optionMatch(z,"quote") ){
if( i+1<nArg
&& azArg[i+1][0]!='-'
int saved_eMode = p->mode.eMode;
modeFree(&p->mode);
modeChange(p, saved_eMode);
- }else if( optionMatch(z,"screenwidth") ){
- if( i+1>=nArg ){
- dotCmdError(p, i, "missing argument", 0);
+ }else if( optionMatch(z,"screenwidth") || optionMatch(z,"sw") ){
+ if( (++i)>=nArg ){
+ dotCmdError(p, i-1, "missing argument", 0);
return 1;
}
- k = pickStr(azArg[i+1],0,"off","auto","");
+ k = pickStr(azArg[i],0,"off","auto","");
if( k==0 ){
p->mode.bAutoScreenWidth = 0;
p->mode.spec.nScreenWidth = 0;
}else if( k==1 ){
p->mode.bAutoScreenWidth = 1;
}else{
- i64 w = integerValue(azArg[i+1]);
+ i64 w = integerValue(azArg[i]);
p->mode.bAutoScreenWidth = 0;
if( w<0 ) w = 0;
if( w>QRF_MAX_WIDTH ) w = QRF_MAX_WIDTH;
p->mode.spec.nScreenWidth = w;
}
- i++;
chng = 1;
}else if( optionMatch(z,"tag") ){
size_t nByte;