Fossil

Check-in [651f7084]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Coding style tweaks for the new 'test-all-help' command.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 651f70847b2182fca575b3257b09c171aa117364
User & Date: mistachkin 2016-04-02 03:47:02
Context
2016-04-07
12:21
Make the default start page for the "fossil ui" command on a local check-out be "timeline?c=current". The default page is still whatever default the repository specifies for "fossil server" or if using "fossil ui" on any repository other than the current check-out. check-in: 3602486f user: drh tags: trunk
2016-04-02
04:47
Use retry logic for SSL read/write as described in the OpenSSL docs. Closed-Leaf check-in: c13b6ba7 user: mistachkin tags: sslRetry
03:47
Coding style tweaks for the new 'test-all-help' command. check-in: 651f7084 user: mistachkin tags: trunk
00:56
Add new fossil test-all-help command. Spell checked and proof read all help text. Fixed typos. Reworded for clarity in a few places. Cleaned up a few inconsistencies of formatting. No code changes other than the new command. Passes all tests. check-in: 26eef7f8 user: rberteig tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/main.c.

1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
      putchar(*z);
      z++;
    }
  }
  putchar('\n');
}


/*
** COMMAND: test-all-help
** %fossil test-all-help ?OPTIONS?
**
** Show help text for commands and pages.  Useful for proof-reading.
** Defaults to just the CLI commands. Specify --www to see only the web
** pages, or --everything to see both commands and pages.
**
** Options:
**    -e|--everything   Show all commands and pages.
**    -t|--test         Include test- commands
**    -w|--www          Show WWW pages.
*/
void test_all_help_cmd(void){
    int i;
    int mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER;

    if( find_option("www","w",0) ){
        mask = CMDFLAG_WEBPAGE;
    }
    if( find_option("everything","e",0) ){
        mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER | CMDFLAG_WEBPAGE;
    }
    if( find_option("test","t",0) ){
        mask |= CMDFLAG_TEST;
    }

    fossil_print("Help text for:\n");
    if( mask & CMDFLAG_1ST_TIER )   fossil_print(" * Commands\n");
    if( mask & CMDFLAG_2ND_TIER )   fossil_print(" * Auxiliary commands\n");
    if( mask & CMDFLAG_TEST )   fossil_print(" * Test commands\n");
    if( mask & CMDFLAG_WEBPAGE )   fossil_print(" * Web pages\n");
    fossil_print("---\n");
    for(i=0; i<count(aCommand); i++){
        if( (aCommand[i].cmdFlags & mask)==0 ) continue;
        fossil_print("# %s\n", aCommand[i].zName);
        fossil_print("%s\n\n", aCmdHelp[i].zText);
    }
    fossil_print("---\n");
    version_cmd();
}


/*
** WEBPAGE: help
** URL: /help?name=CMD
**
** Show the built-in help text for CMD.  CMD can be a command-line interface
** command or a page name from the web interface.







<





|
|







|
|

|
|
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|

<







1221
1222
1223
1224
1225
1226
1227

1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253

1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267

1268
1269
1270
1271
1272
1273
1274
      putchar(*z);
      z++;
    }
  }
  putchar('\n');
}


/*
** COMMAND: test-all-help
** %fossil test-all-help ?OPTIONS?
**
** Show help text for commands and pages.  Useful for proof-reading.
** Defaults to just the CLI commands.  Specify --www to see only the
** web pages, or --everything to see both commands and pages.
**
** Options:
**    -e|--everything   Show all commands and pages.
**    -t|--test         Include test- commands
**    -w|--www          Show WWW pages.
*/
void test_all_help_cmd(void){
  int i;
  int mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER;

  if( find_option("www","w",0) ){
    mask = CMDFLAG_WEBPAGE;
  }
  if( find_option("everything","e",0) ){
    mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER | CMDFLAG_WEBPAGE;
  }
  if( find_option("test","t",0) ){
    mask |= CMDFLAG_TEST;
  }

  fossil_print("Help text for:\n");
  if( mask & CMDFLAG_1ST_TIER ) fossil_print(" * Commands\n");
  if( mask & CMDFLAG_2ND_TIER ) fossil_print(" * Auxiliary commands\n");
  if( mask & CMDFLAG_TEST )     fossil_print(" * Test commands\n");
  if( mask & CMDFLAG_WEBPAGE )  fossil_print(" * Web pages\n");
  fossil_print("---\n");
  for(i=0; i<count(aCommand); i++){
    if( (aCommand[i].cmdFlags & mask)==0 ) continue;
    fossil_print("# %s\n", aCommand[i].zName);
    fossil_print("%s\n\n", aCmdHelp[i].zText);
  }
  fossil_print("---\n");
  version_cmd();
}


/*
** WEBPAGE: help
** URL: /help?name=CMD
**
** Show the built-in help text for CMD.  CMD can be a command-line interface
** command or a page name from the web interface.