Fossil SCM

New setting "verify-comments" defaults to on, but can be turned off to prevent checkin comment sanity checking. This setting does not appear in the "fossil settings" list unless it differs from the default, or unless the "--extra" argument is added to "fossil settings".

drh 2025-03-16 22:40 trunk
Commit 8f4aedcf849a1a68eaab1d53c13d8400c1c6b0b78f1262700733fe8de4882042
+2 -2
--- src/alerts.c
+++ src/alerts.c
@@ -1259,11 +1259,11 @@
12591259
g.argc = 3;
12601260
}
12611261
pSetting = setting_info(&nSetting);
12621262
for(; nSetting>0; nSetting--, pSetting++ ){
12631263
if( strncmp(pSetting->name,"email-",6)!=0 ) continue;
1264
- print_setting(pSetting, 0);
1264
+ print_setting(pSetting, 0, 0);
12651265
}
12661266
}else
12671267
if( strncmp(zCmd, "status", nCmd)==0 ){
12681268
Stmt q;
12691269
int iCutoff;
@@ -1274,11 +1274,11 @@
12741274
verify_all_options();
12751275
if( g.argc!=3 ) usage("status");
12761276
pSetting = setting_info(&nSetting);
12771277
for(; nSetting>0; nSetting--, pSetting++ ){
12781278
if( strncmp(pSetting->name,"email-",6)!=0 ) continue;
1279
- print_setting(pSetting, 0);
1279
+ print_setting(pSetting, 0, 0);
12801280
}
12811281
n = db_int(0,"SELECT count(*) FROM pending_alert WHERE NOT sentSep");
12821282
fossil_print(zFmt/*works-like:"%s%d"*/, "pending-alerts", n);
12831283
n = db_int(0,"SELECT count(*) FROM pending_alert WHERE NOT sentDigest");
12841284
fossil_print(zFmt/*works-like:"%s%d"*/, "pending-digest-alerts", n);
12851285
--- src/alerts.c
+++ src/alerts.c
@@ -1259,11 +1259,11 @@
1259 g.argc = 3;
1260 }
1261 pSetting = setting_info(&nSetting);
1262 for(; nSetting>0; nSetting--, pSetting++ ){
1263 if( strncmp(pSetting->name,"email-",6)!=0 ) continue;
1264 print_setting(pSetting, 0);
1265 }
1266 }else
1267 if( strncmp(zCmd, "status", nCmd)==0 ){
1268 Stmt q;
1269 int iCutoff;
@@ -1274,11 +1274,11 @@
1274 verify_all_options();
1275 if( g.argc!=3 ) usage("status");
1276 pSetting = setting_info(&nSetting);
1277 for(; nSetting>0; nSetting--, pSetting++ ){
1278 if( strncmp(pSetting->name,"email-",6)!=0 ) continue;
1279 print_setting(pSetting, 0);
1280 }
1281 n = db_int(0,"SELECT count(*) FROM pending_alert WHERE NOT sentSep");
1282 fossil_print(zFmt/*works-like:"%s%d"*/, "pending-alerts", n);
1283 n = db_int(0,"SELECT count(*) FROM pending_alert WHERE NOT sentDigest");
1284 fossil_print(zFmt/*works-like:"%s%d"*/, "pending-digest-alerts", n);
1285
--- src/alerts.c
+++ src/alerts.c
@@ -1259,11 +1259,11 @@
1259 g.argc = 3;
1260 }
1261 pSetting = setting_info(&nSetting);
1262 for(; nSetting>0; nSetting--, pSetting++ ){
1263 if( strncmp(pSetting->name,"email-",6)!=0 ) continue;
1264 print_setting(pSetting, 0, 0);
1265 }
1266 }else
1267 if( strncmp(zCmd, "status", nCmd)==0 ){
1268 Stmt q;
1269 int iCutoff;
@@ -1274,11 +1274,11 @@
1274 verify_all_options();
1275 if( g.argc!=3 ) usage("status");
1276 pSetting = setting_info(&nSetting);
1277 for(; nSetting>0; nSetting--, pSetting++ ){
1278 if( strncmp(pSetting->name,"email-",6)!=0 ) continue;
1279 print_setting(pSetting, 0, 0);
1280 }
1281 n = db_int(0,"SELECT count(*) FROM pending_alert WHERE NOT sentSep");
1282 fossil_print(zFmt/*works-like:"%s%d"*/, "pending-alerts", n);
1283 n = db_int(0,"SELECT count(*) FROM pending_alert WHERE NOT sentDigest");
1284 fossil_print(zFmt/*works-like:"%s%d"*/, "pending-digest-alerts", n);
1285
--- src/checkin.c
+++ src/checkin.c
@@ -2282,10 +2282,21 @@
22822282
char **pA = (char**)a;
22832283
char **pB = (char**)b;
22842284
return fossil_strcmp(pA[0], pB[0]);
22852285
}
22862286
2287
+/*
2288
+** SETTING: verify-comments boolean default=on show-only-if-changed
2289
+**
2290
+** If enabled (the default) then the "fossil commit" command does sanity
2291
+** checking on the checkin comment. The sanity checks can be overridden
2292
+** on a case by case basis using the --allow-suspect-comment option to
2293
+** the "fossil commit" command. If disabled, this setting makes every
2294
+** "fossil commit" behave as if the --allow-suspect-comment option were
2295
+** provided.
2296
+*/
2297
+
22872298
/*
22882299
** Check for possible formatting errors in the comment string pComment.
22892300
** If found, write a description of the problem(s) into pSus and return
22902301
** true. If everything looks ok, return false.
22912302
*/
@@ -2295,10 +2306,11 @@
22952306
char *zEnd, *zEnd2;
22962307
char *zSep;
22972308
char cSave1;
22982309
int nIssue = 0;
22992310
2311
+ if( !db_get_boolean("verify-comments",1) ) return 0;
23002312
z = zStart;
23012313
blob_init(pSus, 0, 0);
23022314
while( (z = strchr(z,'['))!=0 ){
23032315
zEnd = strchr(z,']');
23042316
if( zEnd==0 ){
23052317
--- src/checkin.c
+++ src/checkin.c
@@ -2282,10 +2282,21 @@
2282 char **pA = (char**)a;
2283 char **pB = (char**)b;
2284 return fossil_strcmp(pA[0], pB[0]);
2285 }
2286
 
 
 
 
 
 
 
 
 
 
 
2287 /*
2288 ** Check for possible formatting errors in the comment string pComment.
2289 ** If found, write a description of the problem(s) into pSus and return
2290 ** true. If everything looks ok, return false.
2291 */
@@ -2295,10 +2306,11 @@
2295 char *zEnd, *zEnd2;
2296 char *zSep;
2297 char cSave1;
2298 int nIssue = 0;
2299
 
2300 z = zStart;
2301 blob_init(pSus, 0, 0);
2302 while( (z = strchr(z,'['))!=0 ){
2303 zEnd = strchr(z,']');
2304 if( zEnd==0 ){
2305
--- src/checkin.c
+++ src/checkin.c
@@ -2282,10 +2282,21 @@
2282 char **pA = (char**)a;
2283 char **pB = (char**)b;
2284 return fossil_strcmp(pA[0], pB[0]);
2285 }
2286
2287 /*
2288 ** SETTING: verify-comments boolean default=on show-only-if-changed
2289 **
2290 ** If enabled (the default) then the "fossil commit" command does sanity
2291 ** checking on the checkin comment. The sanity checks can be overridden
2292 ** on a case by case basis using the --allow-suspect-comment option to
2293 ** the "fossil commit" command. If disabled, this setting makes every
2294 ** "fossil commit" behave as if the --allow-suspect-comment option were
2295 ** provided.
2296 */
2297
2298 /*
2299 ** Check for possible formatting errors in the comment string pComment.
2300 ** If found, write a description of the problem(s) into pSus and return
2301 ** true. If everything looks ok, return false.
2302 */
@@ -2295,10 +2306,11 @@
2306 char *zEnd, *zEnd2;
2307 char *zSep;
2308 char cSave1;
2309 int nIssue = 0;
2310
2311 if( !db_get_boolean("verify-comments",1) ) return 0;
2312 z = zStart;
2313 blob_init(pSus, 0, 0);
2314 while( (z = strchr(z,'['))!=0 ){
2315 zEnd = strchr(z,']');
2316 if( zEnd==0 ){
2317
+22 -6
--- src/db.c
+++ src/db.c
@@ -4440,13 +4440,14 @@
44404440
44414441
/*
44424442
** Print the current value of a setting identified by the pSetting
44434443
** pointer.
44444444
*/
4445
-void print_setting(const Setting *pSetting, int valueOnly){
4445
+void print_setting(const Setting *pSetting, int valueOnly, int bAlways){
44464446
Stmt q;
44474447
int versioned = 0;
4448
+ if( !pSetting->bIfChng ) bAlways = 1;
44484449
if( pSetting->versionable && g.localOpen ){
44494450
/* Check to see if this is overridden by a versionable settings file */
44504451
Blob versionedPathname;
44514452
blob_zero(&versionedPathname);
44524453
blob_appendf(&versionedPathname, "%s.fossil-settings/%s",
@@ -4455,11 +4456,16 @@
44554456
versioned = 1;
44564457
}
44574458
blob_reset(&versionedPathname);
44584459
}
44594460
if( valueOnly && versioned ){
4460
- fossil_print("%s\n", db_get_versioned(pSetting->name, NULL, NULL));
4461
+ const char *zVal = db_get_versioned(pSetting->name, NULL, NULL);
4462
+ if( bAlways || (zVal!=0 && fossil_strcmp(zVal, pSetting->def)!=0) ){
4463
+ fossil_print("%s\n", db_get_versioned(pSetting->name, NULL, NULL));
4464
+ }else{
4465
+ versioned = 0;
4466
+ }
44614467
return;
44624468
}
44634469
if( g.repositoryOpen ){
44644470
db_prepare(&q,
44654471
"SELECT '(local)', value FROM config WHERE name=%Q"
@@ -4472,16 +4478,21 @@
44724478
"SELECT '(global)', value FROM global_config WHERE name=%Q",
44734479
pSetting->name
44744480
);
44754481
}
44764482
if( db_step(&q)==SQLITE_ROW ){
4477
- if( valueOnly ){
4483
+ const char *zVal = db_column_text(&q,1);
4484
+ if( !bAlways && (zVal==0 || fossil_strcmp(zVal, pSetting->def)==0) ){
4485
+ /* Don't display because the value is equal to the default */
4486
+ }else if( valueOnly ){
44784487
fossil_print("%s\n", db_column_text(&q, 1));
44794488
}else{
44804489
fossil_print("%-20s %-8s %s\n", pSetting->name, db_column_text(&q, 0),
44814490
db_column_text(&q, 1));
44824491
}
4492
+ }else if( !bAlways ){
4493
+ /* Display nothing */
44834494
}else if( valueOnly ){
44844495
fossil_print("\n");
44854496
}else{
44864497
fossil_print("%-20s\n", pSetting->name);
44874498
}
@@ -4516,12 +4527,14 @@
45164527
** negative for values which should not appear
45174528
** on the /setup_settings page. */
45184529
char versionable; /* Is this setting versionable? */
45194530
char forceTextArea; /* Force using a text area for display? */
45204531
char sensitive; /* True if this a security-sensitive setting */
4532
+ char bIfChng; /* Only display if value differs from default */
45214533
const char *def; /* Default value */
45224534
};
4535
+
45234536
#endif /* INTERFACE */
45244537
45254538
/*
45264539
** SETTING: access-log boolean default=off
45274540
**
@@ -5216,21 +5229,24 @@
52165229
** configuration database. If both a local and a global value exists for a
52175230
** setting, the local value takes precedence. This command normally operates
52185231
** on the local settings. Use the --global option to change global settings.
52195232
**
52205233
** Options:
5234
+** --exact Only consider exact name matches
5235
+** --extra When listing settings, show them all, even those that are
5236
+** normally only shown if there values are different from default
52215237
** --global Set or unset the given property globally instead of
52225238
** setting or unsetting it for the open repository only
5223
-** --exact Only consider exact name matches
52245239
** --value Only show the value of a given property (implies --exact)
52255240
**
52265241
** See also: [[configuration]]
52275242
*/
52285243
void setting_cmd(void){
52295244
int i;
52305245
int globalFlag = find_option("global","g",0)!=0;
52315246
int exactFlag = find_option("exact",0,0)!=0;
5247
+ int extraFlag = find_option("extra",0,0)!=0;
52325248
int valueFlag = find_option("value",0,0)!=0;
52335249
/* Undocumented "--test-for-subsystem SUBSYS" option used to test
52345250
** the db_get_for_subsystem() interface: */
52355251
const char *zSubsys = find_option("test-for-subsystem",0,1);
52365252
int unsetFlag = g.argv[1][0]=='u';
@@ -5255,11 +5271,11 @@
52555271
exactFlag = 1;
52565272
}
52575273
52585274
if( g.argc==2 ){
52595275
for(i=0; i<nSetting; i++){
5260
- print_setting(&aSetting[i], 0);
5276
+ print_setting(&aSetting[i], 0, extraFlag);
52615277
}
52625278
}else if( g.argc==3 || g.argc==4 ){
52635279
const char *zName = g.argv[2];
52645280
int n = (int)strlen(zName);
52655281
const Setting *pSetting = db_find_setting(zName, !exactFlag);
@@ -5310,11 +5326,11 @@
53105326
fossil_print(" [%s]", zValue);
53115327
fossil_free(zValue);
53125328
}
53135329
fossil_print("\n");
53145330
}else{
5315
- print_setting(pSetting, valueFlag);
5331
+ print_setting(pSetting, valueFlag, extraFlag);
53165332
}
53175333
pSetting++;
53185334
}
53195335
}
53205336
}else{
53215337
--- src/db.c
+++ src/db.c
@@ -4440,13 +4440,14 @@
4440
4441 /*
4442 ** Print the current value of a setting identified by the pSetting
4443 ** pointer.
4444 */
4445 void print_setting(const Setting *pSetting, int valueOnly){
4446 Stmt q;
4447 int versioned = 0;
 
4448 if( pSetting->versionable && g.localOpen ){
4449 /* Check to see if this is overridden by a versionable settings file */
4450 Blob versionedPathname;
4451 blob_zero(&versionedPathname);
4452 blob_appendf(&versionedPathname, "%s.fossil-settings/%s",
@@ -4455,11 +4456,16 @@
4455 versioned = 1;
4456 }
4457 blob_reset(&versionedPathname);
4458 }
4459 if( valueOnly && versioned ){
4460 fossil_print("%s\n", db_get_versioned(pSetting->name, NULL, NULL));
 
 
 
 
 
4461 return;
4462 }
4463 if( g.repositoryOpen ){
4464 db_prepare(&q,
4465 "SELECT '(local)', value FROM config WHERE name=%Q"
@@ -4472,16 +4478,21 @@
4472 "SELECT '(global)', value FROM global_config WHERE name=%Q",
4473 pSetting->name
4474 );
4475 }
4476 if( db_step(&q)==SQLITE_ROW ){
4477 if( valueOnly ){
 
 
 
4478 fossil_print("%s\n", db_column_text(&q, 1));
4479 }else{
4480 fossil_print("%-20s %-8s %s\n", pSetting->name, db_column_text(&q, 0),
4481 db_column_text(&q, 1));
4482 }
 
 
4483 }else if( valueOnly ){
4484 fossil_print("\n");
4485 }else{
4486 fossil_print("%-20s\n", pSetting->name);
4487 }
@@ -4516,12 +4527,14 @@
4516 ** negative for values which should not appear
4517 ** on the /setup_settings page. */
4518 char versionable; /* Is this setting versionable? */
4519 char forceTextArea; /* Force using a text area for display? */
4520 char sensitive; /* True if this a security-sensitive setting */
 
4521 const char *def; /* Default value */
4522 };
 
4523 #endif /* INTERFACE */
4524
4525 /*
4526 ** SETTING: access-log boolean default=off
4527 **
@@ -5216,21 +5229,24 @@
5216 ** configuration database. If both a local and a global value exists for a
5217 ** setting, the local value takes precedence. This command normally operates
5218 ** on the local settings. Use the --global option to change global settings.
5219 **
5220 ** Options:
 
 
 
5221 ** --global Set or unset the given property globally instead of
5222 ** setting or unsetting it for the open repository only
5223 ** --exact Only consider exact name matches
5224 ** --value Only show the value of a given property (implies --exact)
5225 **
5226 ** See also: [[configuration]]
5227 */
5228 void setting_cmd(void){
5229 int i;
5230 int globalFlag = find_option("global","g",0)!=0;
5231 int exactFlag = find_option("exact",0,0)!=0;
 
5232 int valueFlag = find_option("value",0,0)!=0;
5233 /* Undocumented "--test-for-subsystem SUBSYS" option used to test
5234 ** the db_get_for_subsystem() interface: */
5235 const char *zSubsys = find_option("test-for-subsystem",0,1);
5236 int unsetFlag = g.argv[1][0]=='u';
@@ -5255,11 +5271,11 @@
5255 exactFlag = 1;
5256 }
5257
5258 if( g.argc==2 ){
5259 for(i=0; i<nSetting; i++){
5260 print_setting(&aSetting[i], 0);
5261 }
5262 }else if( g.argc==3 || g.argc==4 ){
5263 const char *zName = g.argv[2];
5264 int n = (int)strlen(zName);
5265 const Setting *pSetting = db_find_setting(zName, !exactFlag);
@@ -5310,11 +5326,11 @@
5310 fossil_print(" [%s]", zValue);
5311 fossil_free(zValue);
5312 }
5313 fossil_print("\n");
5314 }else{
5315 print_setting(pSetting, valueFlag);
5316 }
5317 pSetting++;
5318 }
5319 }
5320 }else{
5321
--- src/db.c
+++ src/db.c
@@ -4440,13 +4440,14 @@
4440
4441 /*
4442 ** Print the current value of a setting identified by the pSetting
4443 ** pointer.
4444 */
4445 void print_setting(const Setting *pSetting, int valueOnly, int bAlways){
4446 Stmt q;
4447 int versioned = 0;
4448 if( !pSetting->bIfChng ) bAlways = 1;
4449 if( pSetting->versionable && g.localOpen ){
4450 /* Check to see if this is overridden by a versionable settings file */
4451 Blob versionedPathname;
4452 blob_zero(&versionedPathname);
4453 blob_appendf(&versionedPathname, "%s.fossil-settings/%s",
@@ -4455,11 +4456,16 @@
4456 versioned = 1;
4457 }
4458 blob_reset(&versionedPathname);
4459 }
4460 if( valueOnly && versioned ){
4461 const char *zVal = db_get_versioned(pSetting->name, NULL, NULL);
4462 if( bAlways || (zVal!=0 && fossil_strcmp(zVal, pSetting->def)!=0) ){
4463 fossil_print("%s\n", db_get_versioned(pSetting->name, NULL, NULL));
4464 }else{
4465 versioned = 0;
4466 }
4467 return;
4468 }
4469 if( g.repositoryOpen ){
4470 db_prepare(&q,
4471 "SELECT '(local)', value FROM config WHERE name=%Q"
@@ -4472,16 +4478,21 @@
4478 "SELECT '(global)', value FROM global_config WHERE name=%Q",
4479 pSetting->name
4480 );
4481 }
4482 if( db_step(&q)==SQLITE_ROW ){
4483 const char *zVal = db_column_text(&q,1);
4484 if( !bAlways && (zVal==0 || fossil_strcmp(zVal, pSetting->def)==0) ){
4485 /* Don't display because the value is equal to the default */
4486 }else if( valueOnly ){
4487 fossil_print("%s\n", db_column_text(&q, 1));
4488 }else{
4489 fossil_print("%-20s %-8s %s\n", pSetting->name, db_column_text(&q, 0),
4490 db_column_text(&q, 1));
4491 }
4492 }else if( !bAlways ){
4493 /* Display nothing */
4494 }else if( valueOnly ){
4495 fossil_print("\n");
4496 }else{
4497 fossil_print("%-20s\n", pSetting->name);
4498 }
@@ -4516,12 +4527,14 @@
4527 ** negative for values which should not appear
4528 ** on the /setup_settings page. */
4529 char versionable; /* Is this setting versionable? */
4530 char forceTextArea; /* Force using a text area for display? */
4531 char sensitive; /* True if this a security-sensitive setting */
4532 char bIfChng; /* Only display if value differs from default */
4533 const char *def; /* Default value */
4534 };
4535
4536 #endif /* INTERFACE */
4537
4538 /*
4539 ** SETTING: access-log boolean default=off
4540 **
@@ -5216,21 +5229,24 @@
5229 ** configuration database. If both a local and a global value exists for a
5230 ** setting, the local value takes precedence. This command normally operates
5231 ** on the local settings. Use the --global option to change global settings.
5232 **
5233 ** Options:
5234 ** --exact Only consider exact name matches
5235 ** --extra When listing settings, show them all, even those that are
5236 ** normally only shown if there values are different from default
5237 ** --global Set or unset the given property globally instead of
5238 ** setting or unsetting it for the open repository only
 
5239 ** --value Only show the value of a given property (implies --exact)
5240 **
5241 ** See also: [[configuration]]
5242 */
5243 void setting_cmd(void){
5244 int i;
5245 int globalFlag = find_option("global","g",0)!=0;
5246 int exactFlag = find_option("exact",0,0)!=0;
5247 int extraFlag = find_option("extra",0,0)!=0;
5248 int valueFlag = find_option("value",0,0)!=0;
5249 /* Undocumented "--test-for-subsystem SUBSYS" option used to test
5250 ** the db_get_for_subsystem() interface: */
5251 const char *zSubsys = find_option("test-for-subsystem",0,1);
5252 int unsetFlag = g.argv[1][0]=='u';
@@ -5255,11 +5271,11 @@
5271 exactFlag = 1;
5272 }
5273
5274 if( g.argc==2 ){
5275 for(i=0; i<nSetting; i++){
5276 print_setting(&aSetting[i], 0, extraFlag);
5277 }
5278 }else if( g.argc==3 || g.argc==4 ){
5279 const char *zName = g.argv[2];
5280 int n = (int)strlen(zName);
5281 const Setting *pSetting = db_find_setting(zName, !exactFlag);
@@ -5310,11 +5326,11 @@
5326 fossil_print(" [%s]", zValue);
5327 fossil_free(zValue);
5328 }
5329 fossil_print("\n");
5330 }else{
5331 print_setting(pSetting, valueFlag, extraFlag);
5332 }
5333 pSetting++;
5334 }
5335 }
5336 }else{
5337
+22 -18
--- tools/mkindex.c
+++ tools/mkindex.c
@@ -85,26 +85,27 @@
8585
8686
/***************************************************************************
8787
** These macros must match similar macros in dispatch.c.
8888
**
8989
** Allowed values for CmdOrPage.eCmdFlags. */
90
-#define CMDFLAG_1ST_TIER 0x0001 /* Most important commands */
91
-#define CMDFLAG_2ND_TIER 0x0002 /* Obscure and seldom used commands */
92
-#define CMDFLAG_TEST 0x0004 /* Commands for testing only */
93
-#define CMDFLAG_WEBPAGE 0x0008 /* Web pages */
94
-#define CMDFLAG_COMMAND 0x0010 /* A command */
95
-#define CMDFLAG_SETTING 0x0020 /* A setting */
96
-#define CMDFLAG_VERSIONABLE 0x0040 /* A versionable setting */
97
-#define CMDFLAG_BLOCKTEXT 0x0080 /* Multi-line text setting */
98
-#define CMDFLAG_BOOLEAN 0x0100 /* A boolean setting */
99
-#define CMDFLAG_RAWCONTENT 0x0200 /* Do not interpret webpage content */
100
-#define CMDFLAG_SENSITIVE 0x0400 /* Security-sensitive setting */
101
-#define CMDFLAG_HIDDEN 0x0800 /* Elide from most listings */
102
-#define CMDFLAG_LDAVG_EXEMPT 0x1000 /* Exempt from load_control() */
103
-#define CMDFLAG_ALIAS 0x2000 /* Command aliases */
104
-#define CMDFLAG_KEEPEMPTY 0x4000 /* Do not unset empty settings */
105
-#define CMDFLAG_ABBREVSUBCMD 0x8000 /* Abbreviated subcmd in help text */
90
+#define CMDFLAG_1ST_TIER 0x00001 /* Most important commands */
91
+#define CMDFLAG_2ND_TIER 0x00002 /* Obscure and seldom used commands */
92
+#define CMDFLAG_TEST 0x00004 /* Commands for testing only */
93
+#define CMDFLAG_WEBPAGE 0x00008 /* Web pages */
94
+#define CMDFLAG_COMMAND 0x00010 /* A command */
95
+#define CMDFLAG_SETTING 0x00020 /* A setting */
96
+#define CMDFLAG_VERSIONABLE 0x00040 /* A versionable setting */
97
+#define CMDFLAG_BLOCKTEXT 0x00080 /* Multi-line text setting */
98
+#define CMDFLAG_BOOLEAN 0x00100 /* A boolean setting */
99
+#define CMDFLAG_RAWCONTENT 0x00200 /* Do not interpret webpage content */
100
+#define CMDFLAG_SENSITIVE 0x00400 /* Security-sensitive setting */
101
+#define CMDFLAG_HIDDEN 0x00800 /* Elide from most listings */
102
+#define CMDFLAG_LDAVG_EXEMPT 0x01000 /* Exempt from load_control() */
103
+#define CMDFLAG_ALIAS 0x02000 /* Command aliases */
104
+#define CMDFLAG_KEEPEMPTY 0x04000 /* Do not unset empty settings */
105
+#define CMDFLAG_ABBREVSUBCMD 0x08000 /* Abbreviated subcmd in help text */
106
+#define CMDFLAG_IFCHNG 0x10000 /* Show settting only if not default */
106107
/**************************************************************************/
107108
108109
/*
109110
** Each entry looks like this:
110111
*/
@@ -283,10 +284,12 @@
283284
aEntry[nUsed].eType |= CMDFLAG_HIDDEN;
284285
}else if( j==14 && strncmp(&zLine[i], "loadavg-exempt", 14)==0 ){
285286
aEntry[nUsed].eType |= CMDFLAG_LDAVG_EXEMPT;
286287
}else if( j==23 && strncmp(&zLine[i], "abbreviated-subcommands", 23)==0 ){
287288
aEntry[nUsed].eType |= CMDFLAG_ABBREVSUBCMD;
289
+ }else if( j==20 && strncmp(&zLine[i], "show-only-if-changed", 20)==0 ){
290
+ aEntry[nUsed].eType |= CMDFLAG_IFCHNG;
288291
}else{
289292
fprintf(stderr, "%s:%d: unknown option: '%.*s'\n",
290293
zFile, nLine, j, &zLine[i]);
291294
nErr++;
292295
}
@@ -515,22 +518,23 @@
515518
if( zVar ){
516519
printf(" \"%s\",%*s", zVar, (int)(15-strlen(zVar)), "");
517520
}else{
518521
printf(" 0,%*s", 16, "");
519522
}
520
- printf(" %3d, %d, %d, %d, \"%s\"%*s },\n",
523
+ printf(" %3d, %d, %d, %d, %d, \"%s\"%*s },\n",
521524
aEntry[i].iWidth,
522525
(aEntry[i].eType & CMDFLAG_VERSIONABLE)!=0,
523526
(aEntry[i].eType & CMDFLAG_BLOCKTEXT)!=0,
524527
(aEntry[i].eType & CMDFLAG_SENSITIVE)!=0,
528
+ (aEntry[i].eType & CMDFLAG_IFCHNG)!=0,
525529
zDef, (int)(10-strlen(zDef)), ""
526530
);
527531
if( aEntry[i].zIf ){
528532
printf("#endif\n");
529533
}
530534
}
531
- printf("{0,0,0,0,0,0,0}};\n");
535
+ printf("{0,0,0,0,0,0,0,0}};\n");
532536
533537
}
534538
535539
/*
536540
** Process a single file of input
537541
--- tools/mkindex.c
+++ tools/mkindex.c
@@ -85,26 +85,27 @@
85
86 /***************************************************************************
87 ** These macros must match similar macros in dispatch.c.
88 **
89 ** Allowed values for CmdOrPage.eCmdFlags. */
90 #define CMDFLAG_1ST_TIER 0x0001 /* Most important commands */
91 #define CMDFLAG_2ND_TIER 0x0002 /* Obscure and seldom used commands */
92 #define CMDFLAG_TEST 0x0004 /* Commands for testing only */
93 #define CMDFLAG_WEBPAGE 0x0008 /* Web pages */
94 #define CMDFLAG_COMMAND 0x0010 /* A command */
95 #define CMDFLAG_SETTING 0x0020 /* A setting */
96 #define CMDFLAG_VERSIONABLE 0x0040 /* A versionable setting */
97 #define CMDFLAG_BLOCKTEXT 0x0080 /* Multi-line text setting */
98 #define CMDFLAG_BOOLEAN 0x0100 /* A boolean setting */
99 #define CMDFLAG_RAWCONTENT 0x0200 /* Do not interpret webpage content */
100 #define CMDFLAG_SENSITIVE 0x0400 /* Security-sensitive setting */
101 #define CMDFLAG_HIDDEN 0x0800 /* Elide from most listings */
102 #define CMDFLAG_LDAVG_EXEMPT 0x1000 /* Exempt from load_control() */
103 #define CMDFLAG_ALIAS 0x2000 /* Command aliases */
104 #define CMDFLAG_KEEPEMPTY 0x4000 /* Do not unset empty settings */
105 #define CMDFLAG_ABBREVSUBCMD 0x8000 /* Abbreviated subcmd in help text */
 
106 /**************************************************************************/
107
108 /*
109 ** Each entry looks like this:
110 */
@@ -283,10 +284,12 @@
283 aEntry[nUsed].eType |= CMDFLAG_HIDDEN;
284 }else if( j==14 && strncmp(&zLine[i], "loadavg-exempt", 14)==0 ){
285 aEntry[nUsed].eType |= CMDFLAG_LDAVG_EXEMPT;
286 }else if( j==23 && strncmp(&zLine[i], "abbreviated-subcommands", 23)==0 ){
287 aEntry[nUsed].eType |= CMDFLAG_ABBREVSUBCMD;
 
 
288 }else{
289 fprintf(stderr, "%s:%d: unknown option: '%.*s'\n",
290 zFile, nLine, j, &zLine[i]);
291 nErr++;
292 }
@@ -515,22 +518,23 @@
515 if( zVar ){
516 printf(" \"%s\",%*s", zVar, (int)(15-strlen(zVar)), "");
517 }else{
518 printf(" 0,%*s", 16, "");
519 }
520 printf(" %3d, %d, %d, %d, \"%s\"%*s },\n",
521 aEntry[i].iWidth,
522 (aEntry[i].eType & CMDFLAG_VERSIONABLE)!=0,
523 (aEntry[i].eType & CMDFLAG_BLOCKTEXT)!=0,
524 (aEntry[i].eType & CMDFLAG_SENSITIVE)!=0,
 
525 zDef, (int)(10-strlen(zDef)), ""
526 );
527 if( aEntry[i].zIf ){
528 printf("#endif\n");
529 }
530 }
531 printf("{0,0,0,0,0,0,0}};\n");
532
533 }
534
535 /*
536 ** Process a single file of input
537
--- tools/mkindex.c
+++ tools/mkindex.c
@@ -85,26 +85,27 @@
85
86 /***************************************************************************
87 ** These macros must match similar macros in dispatch.c.
88 **
89 ** Allowed values for CmdOrPage.eCmdFlags. */
90 #define CMDFLAG_1ST_TIER 0x00001 /* Most important commands */
91 #define CMDFLAG_2ND_TIER 0x00002 /* Obscure and seldom used commands */
92 #define CMDFLAG_TEST 0x00004 /* Commands for testing only */
93 #define CMDFLAG_WEBPAGE 0x00008 /* Web pages */
94 #define CMDFLAG_COMMAND 0x00010 /* A command */
95 #define CMDFLAG_SETTING 0x00020 /* A setting */
96 #define CMDFLAG_VERSIONABLE 0x00040 /* A versionable setting */
97 #define CMDFLAG_BLOCKTEXT 0x00080 /* Multi-line text setting */
98 #define CMDFLAG_BOOLEAN 0x00100 /* A boolean setting */
99 #define CMDFLAG_RAWCONTENT 0x00200 /* Do not interpret webpage content */
100 #define CMDFLAG_SENSITIVE 0x00400 /* Security-sensitive setting */
101 #define CMDFLAG_HIDDEN 0x00800 /* Elide from most listings */
102 #define CMDFLAG_LDAVG_EXEMPT 0x01000 /* Exempt from load_control() */
103 #define CMDFLAG_ALIAS 0x02000 /* Command aliases */
104 #define CMDFLAG_KEEPEMPTY 0x04000 /* Do not unset empty settings */
105 #define CMDFLAG_ABBREVSUBCMD 0x08000 /* Abbreviated subcmd in help text */
106 #define CMDFLAG_IFCHNG 0x10000 /* Show settting only if not default */
107 /**************************************************************************/
108
109 /*
110 ** Each entry looks like this:
111 */
@@ -283,10 +284,12 @@
284 aEntry[nUsed].eType |= CMDFLAG_HIDDEN;
285 }else if( j==14 && strncmp(&zLine[i], "loadavg-exempt", 14)==0 ){
286 aEntry[nUsed].eType |= CMDFLAG_LDAVG_EXEMPT;
287 }else if( j==23 && strncmp(&zLine[i], "abbreviated-subcommands", 23)==0 ){
288 aEntry[nUsed].eType |= CMDFLAG_ABBREVSUBCMD;
289 }else if( j==20 && strncmp(&zLine[i], "show-only-if-changed", 20)==0 ){
290 aEntry[nUsed].eType |= CMDFLAG_IFCHNG;
291 }else{
292 fprintf(stderr, "%s:%d: unknown option: '%.*s'\n",
293 zFile, nLine, j, &zLine[i]);
294 nErr++;
295 }
@@ -515,22 +518,23 @@
518 if( zVar ){
519 printf(" \"%s\",%*s", zVar, (int)(15-strlen(zVar)), "");
520 }else{
521 printf(" 0,%*s", 16, "");
522 }
523 printf(" %3d, %d, %d, %d, %d, \"%s\"%*s },\n",
524 aEntry[i].iWidth,
525 (aEntry[i].eType & CMDFLAG_VERSIONABLE)!=0,
526 (aEntry[i].eType & CMDFLAG_BLOCKTEXT)!=0,
527 (aEntry[i].eType & CMDFLAG_SENSITIVE)!=0,
528 (aEntry[i].eType & CMDFLAG_IFCHNG)!=0,
529 zDef, (int)(10-strlen(zDef)), ""
530 );
531 if( aEntry[i].zIf ){
532 printf("#endif\n");
533 }
534 }
535 printf("{0,0,0,0,0,0,0,0}};\n");
536
537 }
538
539 /*
540 ** Process a single file of input
541

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button