Fossil SCM

Merged in help-full branch, which adds help --everything flag, and fixed another bit of safe-html setting docs so that they work with the HTML help text export.

stephan 2021-02-05 03:21 trunk merge
Commit 89e5ac196d0dfef46aa373629b6b1798bed0b0b5c51fa5e61e22ea83290a693b
+66 -34
--- src/dispatch.c
+++ src/dispatch.c
@@ -532,45 +532,14 @@
532532
blob_append(pText, zHelp, i);
533533
}
534534
}
535535
536536
/*
537
-** COMMAND: test-all-help
538
-**
539
-** Usage: %fossil test-all-help ?OPTIONS?
540
-**
541
-** Show help text for commands and pages. Useful for proof-reading.
542
-** Defaults to just the CLI commands. Specify --www to see only the
543
-** web pages, or --everything to see both commands and pages.
544
-**
545
-** Options:
546
-** -e|--everything Show all commands and pages.
547
-** -t|--test Include test- commands
548
-** -w|--www Show WWW pages.
549
-** -s|--settings Show settings.
550
-** -h|--html Transform output to HTML.
551
-** -r|--raw No output formatting.
537
+** Display help for all commands based on provided flags.
552538
*/
553
-void test_all_help_cmd(void){
539
+static void display_all_help(int mask, int useHtml, int rawOut){
554540
int i;
555
- int mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER;
556
- int useHtml = find_option("html","h",0)!=0;
557
- int rawOut = find_option("raw","r",0)!=0;
558
-
559
- if( find_option("www","w",0) ){
560
- mask = CMDFLAG_WEBPAGE;
561
- }
562
- if( find_option("everything","e",0) ){
563
- mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER | CMDFLAG_WEBPAGE |
564
- CMDFLAG_SETTING | CMDFLAG_TEST;
565
- }
566
- if( find_option("settings","s",0) ){
567
- mask = CMDFLAG_SETTING;
568
- }
569
- if( find_option("test","t",0) ){
570
- mask |= CMDFLAG_TEST;
571
- }
572541
if( useHtml ) fossil_print("<!--\n");
573542
fossil_print("Help text for:\n");
574543
if( mask & CMDFLAG_1ST_TIER ) fossil_print(" * Commands\n");
575544
if( mask & CMDFLAG_2ND_TIER ) fossil_print(" * Auxiliary commands\n");
576545
if( mask & CMDFLAG_TEST ) fossil_print(" * Test commands\n");
@@ -608,10 +577,48 @@
608577
}else{
609578
fossil_print("---\n");
610579
}
611580
version_cmd();
612581
}
582
+
583
+/*
584
+** COMMAND: test-all-help
585
+**
586
+** Usage: %fossil test-all-help ?OPTIONS?
587
+**
588
+** Show help text for commands and pages. Useful for proof-reading.
589
+** Defaults to just the CLI commands. Specify --www to see only the
590
+** web pages, or --everything to see both commands and pages.
591
+**
592
+** Options:
593
+** -e|--everything Show all commands and pages.
594
+** -t|--test Include test- commands
595
+** -w|--www Show WWW pages.
596
+** -s|--settings Show settings.
597
+** -h|--html Transform output to HTML.
598
+** -r|--raw No output formatting.
599
+*/
600
+void test_all_help_cmd(void){
601
+ int mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER;
602
+ int useHtml = find_option("html","h",0)!=0;
603
+ int rawOut = find_option("raw","r",0)!=0;
604
+
605
+ if( find_option("www","w",0) ){
606
+ mask = CMDFLAG_WEBPAGE;
607
+ }
608
+ if( find_option("everything","e",0) ){
609
+ mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER | CMDFLAG_WEBPAGE |
610
+ CMDFLAG_SETTING | CMDFLAG_TEST;
611
+ }
612
+ if( find_option("settings","s",0) ){
613
+ mask = CMDFLAG_SETTING;
614
+ }
615
+ if( find_option("test","t",0) ){
616
+ mask |= CMDFLAG_TEST;
617
+ }
618
+ display_all_help(mask, useHtml, rawOut);
619
+}
613620
614621
/*
615622
** Count the number of entries in the aCommand[] table that match
616623
** the given flag.
617624
*/
@@ -1025,10 +1032,14 @@
10251032
** -o|--options List command-line options common to all commands
10261033
** -s|--setting List setting names
10271034
** -t|--test List unsupported "test" commands
10281035
** -x|--aux List only auxiliary commands
10291036
** -w|--www List all web pages
1037
+** -f|--full List full set of commands (including auxiliary
1038
+** and unsupported "test" commands), options,
1039
+** settings, and web pages
1040
+** -e|--everything List all help on all topics
10301041
**
10311042
** These options can be used when TOPIC is present:
10321043
**
10331044
** -h|--html Format output as HTML rather than plain text
10341045
** -c|--commands Restrict TOPIC search to commands
@@ -1055,11 +1066,11 @@
10551066
}
10561067
if( find_option("options","o",0) ){
10571068
fossil_print("%s", zOptions);
10581069
return;
10591070
}
1060
- if( find_option("all","a",0) ){
1071
+ else if( find_option("all","a",0) ){
10611072
command_list(0, CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER);
10621073
return;
10631074
}
10641075
else if( find_option("www","w",0) ){
10651076
command_list(0, CMDFLAG_WEBPAGE);
@@ -1074,10 +1085,31 @@
10741085
return;
10751086
}
10761087
else if( find_option("setting","s",0) ){
10771088
command_list(0, CMDFLAG_SETTING);
10781089
return;
1090
+ }
1091
+ else if( find_option("full","f",0) ){
1092
+ fossil_print("fossil commands:\n\n");
1093
+ command_list(0, CMDFLAG_1ST_TIER);
1094
+ fossil_print("\nfossil auxiliary commands:\n\n");
1095
+ command_list(0, CMDFLAG_2ND_TIER);
1096
+ fossil_print("\n%s", zOptions);
1097
+ fossil_print("\nfossil settings:\n\n");
1098
+ command_list(0, CMDFLAG_SETTING);
1099
+ fossil_print("\nfossil web pages:\n\n");
1100
+ command_list(0, CMDFLAG_WEBPAGE);
1101
+ fossil_print("\nfossil test commands (unsupported):\n\n");
1102
+ command_list(0, CMDFLAG_TEST);
1103
+ fossil_print("\n");
1104
+ version_cmd();
1105
+ return;
1106
+ }
1107
+ else if( find_option("everything","e",0) ){
1108
+ display_all_help(CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER | CMDFLAG_WEBPAGE |
1109
+ CMDFLAG_SETTING | CMDFLAG_TEST, 0, 0);
1110
+ return;
10791111
}
10801112
useHtml = find_option("html","h",0)!=0;
10811113
isPage = ('/' == *g.argv[2]) ? 1 : 0;
10821114
if(isPage){
10831115
zCmdOrPage = "page";
10841116
--- src/dispatch.c
+++ src/dispatch.c
@@ -532,45 +532,14 @@
532 blob_append(pText, zHelp, i);
533 }
534 }
535
536 /*
537 ** COMMAND: test-all-help
538 **
539 ** Usage: %fossil test-all-help ?OPTIONS?
540 **
541 ** Show help text for commands and pages. Useful for proof-reading.
542 ** Defaults to just the CLI commands. Specify --www to see only the
543 ** web pages, or --everything to see both commands and pages.
544 **
545 ** Options:
546 ** -e|--everything Show all commands and pages.
547 ** -t|--test Include test- commands
548 ** -w|--www Show WWW pages.
549 ** -s|--settings Show settings.
550 ** -h|--html Transform output to HTML.
551 ** -r|--raw No output formatting.
552 */
553 void test_all_help_cmd(void){
554 int i;
555 int mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER;
556 int useHtml = find_option("html","h",0)!=0;
557 int rawOut = find_option("raw","r",0)!=0;
558
559 if( find_option("www","w",0) ){
560 mask = CMDFLAG_WEBPAGE;
561 }
562 if( find_option("everything","e",0) ){
563 mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER | CMDFLAG_WEBPAGE |
564 CMDFLAG_SETTING | CMDFLAG_TEST;
565 }
566 if( find_option("settings","s",0) ){
567 mask = CMDFLAG_SETTING;
568 }
569 if( find_option("test","t",0) ){
570 mask |= CMDFLAG_TEST;
571 }
572 if( useHtml ) fossil_print("<!--\n");
573 fossil_print("Help text for:\n");
574 if( mask & CMDFLAG_1ST_TIER ) fossil_print(" * Commands\n");
575 if( mask & CMDFLAG_2ND_TIER ) fossil_print(" * Auxiliary commands\n");
576 if( mask & CMDFLAG_TEST ) fossil_print(" * Test commands\n");
@@ -608,10 +577,48 @@
608 }else{
609 fossil_print("---\n");
610 }
611 version_cmd();
612 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
613
614 /*
615 ** Count the number of entries in the aCommand[] table that match
616 ** the given flag.
617 */
@@ -1025,10 +1032,14 @@
1025 ** -o|--options List command-line options common to all commands
1026 ** -s|--setting List setting names
1027 ** -t|--test List unsupported "test" commands
1028 ** -x|--aux List only auxiliary commands
1029 ** -w|--www List all web pages
 
 
 
 
1030 **
1031 ** These options can be used when TOPIC is present:
1032 **
1033 ** -h|--html Format output as HTML rather than plain text
1034 ** -c|--commands Restrict TOPIC search to commands
@@ -1055,11 +1066,11 @@
1055 }
1056 if( find_option("options","o",0) ){
1057 fossil_print("%s", zOptions);
1058 return;
1059 }
1060 if( find_option("all","a",0) ){
1061 command_list(0, CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER);
1062 return;
1063 }
1064 else if( find_option("www","w",0) ){
1065 command_list(0, CMDFLAG_WEBPAGE);
@@ -1074,10 +1085,31 @@
1074 return;
1075 }
1076 else if( find_option("setting","s",0) ){
1077 command_list(0, CMDFLAG_SETTING);
1078 return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1079 }
1080 useHtml = find_option("html","h",0)!=0;
1081 isPage = ('/' == *g.argv[2]) ? 1 : 0;
1082 if(isPage){
1083 zCmdOrPage = "page";
1084
--- src/dispatch.c
+++ src/dispatch.c
@@ -532,45 +532,14 @@
532 blob_append(pText, zHelp, i);
533 }
534 }
535
536 /*
537 ** Display help for all commands based on provided flags.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
538 */
539 static void display_all_help(int mask, int useHtml, int rawOut){
540 int i;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
541 if( useHtml ) fossil_print("<!--\n");
542 fossil_print("Help text for:\n");
543 if( mask & CMDFLAG_1ST_TIER ) fossil_print(" * Commands\n");
544 if( mask & CMDFLAG_2ND_TIER ) fossil_print(" * Auxiliary commands\n");
545 if( mask & CMDFLAG_TEST ) fossil_print(" * Test commands\n");
@@ -608,10 +577,48 @@
577 }else{
578 fossil_print("---\n");
579 }
580 version_cmd();
581 }
582
583 /*
584 ** COMMAND: test-all-help
585 **
586 ** Usage: %fossil test-all-help ?OPTIONS?
587 **
588 ** Show help text for commands and pages. Useful for proof-reading.
589 ** Defaults to just the CLI commands. Specify --www to see only the
590 ** web pages, or --everything to see both commands and pages.
591 **
592 ** Options:
593 ** -e|--everything Show all commands and pages.
594 ** -t|--test Include test- commands
595 ** -w|--www Show WWW pages.
596 ** -s|--settings Show settings.
597 ** -h|--html Transform output to HTML.
598 ** -r|--raw No output formatting.
599 */
600 void test_all_help_cmd(void){
601 int mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER;
602 int useHtml = find_option("html","h",0)!=0;
603 int rawOut = find_option("raw","r",0)!=0;
604
605 if( find_option("www","w",0) ){
606 mask = CMDFLAG_WEBPAGE;
607 }
608 if( find_option("everything","e",0) ){
609 mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER | CMDFLAG_WEBPAGE |
610 CMDFLAG_SETTING | CMDFLAG_TEST;
611 }
612 if( find_option("settings","s",0) ){
613 mask = CMDFLAG_SETTING;
614 }
615 if( find_option("test","t",0) ){
616 mask |= CMDFLAG_TEST;
617 }
618 display_all_help(mask, useHtml, rawOut);
619 }
620
621 /*
622 ** Count the number of entries in the aCommand[] table that match
623 ** the given flag.
624 */
@@ -1025,10 +1032,14 @@
1032 ** -o|--options List command-line options common to all commands
1033 ** -s|--setting List setting names
1034 ** -t|--test List unsupported "test" commands
1035 ** -x|--aux List only auxiliary commands
1036 ** -w|--www List all web pages
1037 ** -f|--full List full set of commands (including auxiliary
1038 ** and unsupported "test" commands), options,
1039 ** settings, and web pages
1040 ** -e|--everything List all help on all topics
1041 **
1042 ** These options can be used when TOPIC is present:
1043 **
1044 ** -h|--html Format output as HTML rather than plain text
1045 ** -c|--commands Restrict TOPIC search to commands
@@ -1055,11 +1066,11 @@
1066 }
1067 if( find_option("options","o",0) ){
1068 fossil_print("%s", zOptions);
1069 return;
1070 }
1071 else if( find_option("all","a",0) ){
1072 command_list(0, CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER);
1073 return;
1074 }
1075 else if( find_option("www","w",0) ){
1076 command_list(0, CMDFLAG_WEBPAGE);
@@ -1074,10 +1085,31 @@
1085 return;
1086 }
1087 else if( find_option("setting","s",0) ){
1088 command_list(0, CMDFLAG_SETTING);
1089 return;
1090 }
1091 else if( find_option("full","f",0) ){
1092 fossil_print("fossil commands:\n\n");
1093 command_list(0, CMDFLAG_1ST_TIER);
1094 fossil_print("\nfossil auxiliary commands:\n\n");
1095 command_list(0, CMDFLAG_2ND_TIER);
1096 fossil_print("\n%s", zOptions);
1097 fossil_print("\nfossil settings:\n\n");
1098 command_list(0, CMDFLAG_SETTING);
1099 fossil_print("\nfossil web pages:\n\n");
1100 command_list(0, CMDFLAG_WEBPAGE);
1101 fossil_print("\nfossil test commands (unsupported):\n\n");
1102 command_list(0, CMDFLAG_TEST);
1103 fossil_print("\n");
1104 version_cmd();
1105 return;
1106 }
1107 else if( find_option("everything","e",0) ){
1108 display_all_help(CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER | CMDFLAG_WEBPAGE |
1109 CMDFLAG_SETTING | CMDFLAG_TEST, 0, 0);
1110 return;
1111 }
1112 useHtml = find_option("html","h",0)!=0;
1113 isPage = ('/' == *g.argv[2]) ? 1 : 0;
1114 if(isPage){
1115 zCmdOrPage = "page";
1116
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -2745,19 +2745,19 @@
27452745
}
27462746
27472747
/*
27482748
** SETTING: safe-html width=8
27492749
** This setting controls whether or not unsafe HTML elements
2750
-** (such as <script> or <style>) are allowed in Markdown-formatted
2750
+** (such as SCRIPT or STYLE tags) are allowed in Markdown-formatted
27512751
** documents. Unsafe HTML is disabled by default. If this setting
27522752
** exists and is a string, then letters in that string can enable
27532753
** unsafe HTML in various contexts:
27542754
**
2755
-** b Unsafe HTML allowed in embedded documentation
2756
-** f Unsafe HTML allowed in forum posts
2757
-** t Unsafe HTML allowed in tickets
2758
-** w Unsafe HTML allowed on wiki pages
2755
+** - b Unsafe HTML allowed in embedded documentation
2756
+** - f Unsafe HTML allowed in forum posts
2757
+** - t Unsafe HTML allowed in tickets
2758
+** - w Unsafe HTML allowed on wiki pages
27592759
*/
27602760
/*
27612761
** The input blob contains HTML. If safe-html is enabled, then
27622762
** convert the input into "safe HTML". The following modifications
27632763
** are made:
27642764
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -2745,19 +2745,19 @@
2745 }
2746
2747 /*
2748 ** SETTING: safe-html width=8
2749 ** This setting controls whether or not unsafe HTML elements
2750 ** (such as <script> or <style>) are allowed in Markdown-formatted
2751 ** documents. Unsafe HTML is disabled by default. If this setting
2752 ** exists and is a string, then letters in that string can enable
2753 ** unsafe HTML in various contexts:
2754 **
2755 ** b Unsafe HTML allowed in embedded documentation
2756 ** f Unsafe HTML allowed in forum posts
2757 ** t Unsafe HTML allowed in tickets
2758 ** w Unsafe HTML allowed on wiki pages
2759 */
2760 /*
2761 ** The input blob contains HTML. If safe-html is enabled, then
2762 ** convert the input into "safe HTML". The following modifications
2763 ** are made:
2764
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -2745,19 +2745,19 @@
2745 }
2746
2747 /*
2748 ** SETTING: safe-html width=8
2749 ** This setting controls whether or not unsafe HTML elements
2750 ** (such as SCRIPT or STYLE tags) are allowed in Markdown-formatted
2751 ** documents. Unsafe HTML is disabled by default. If this setting
2752 ** exists and is a string, then letters in that string can enable
2753 ** unsafe HTML in various contexts:
2754 **
2755 ** - b Unsafe HTML allowed in embedded documentation
2756 ** - f Unsafe HTML allowed in forum posts
2757 ** - t Unsafe HTML allowed in tickets
2758 ** - w Unsafe HTML allowed on wiki pages
2759 */
2760 /*
2761 ** The input blob contains HTML. If safe-html is enabled, then
2762 ** convert the input into "safe HTML". The following modifications
2763 ** are made:
2764
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -2745,19 +2745,19 @@
27452745
}
27462746
27472747
/*
27482748
** SETTING: safe-html width=8
27492749
** This setting controls whether or not unsafe HTML elements
2750
-** (such as <script> or <style>) are allowed in Markdown-formatted
2750
+** (such as SCRIPT or STYLE tags) are allowed in Markdown-formatted
27512751
** documents. Unsafe HTML is disabled by default. If this setting
27522752
** exists and is a string, then letters in that string can enable
27532753
** unsafe HTML in various contexts:
27542754
**
2755
-** b Unsafe HTML allowed in embedded documentation
2756
-** f Unsafe HTML allowed in forum posts
2757
-** t Unsafe HTML allowed in tickets
2758
-** w Unsafe HTML allowed on wiki pages
2755
+** - b Unsafe HTML allowed in embedded documentation
2756
+** - f Unsafe HTML allowed in forum posts
2757
+** - t Unsafe HTML allowed in tickets
2758
+** - w Unsafe HTML allowed on wiki pages
27592759
*/
27602760
/*
27612761
** The input blob contains HTML. If safe-html is enabled, then
27622762
** convert the input into "safe HTML". The following modifications
27632763
** are made:
27642764
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -2745,19 +2745,19 @@
2745 }
2746
2747 /*
2748 ** SETTING: safe-html width=8
2749 ** This setting controls whether or not unsafe HTML elements
2750 ** (such as <script> or <style>) are allowed in Markdown-formatted
2751 ** documents. Unsafe HTML is disabled by default. If this setting
2752 ** exists and is a string, then letters in that string can enable
2753 ** unsafe HTML in various contexts:
2754 **
2755 ** b Unsafe HTML allowed in embedded documentation
2756 ** f Unsafe HTML allowed in forum posts
2757 ** t Unsafe HTML allowed in tickets
2758 ** w Unsafe HTML allowed on wiki pages
2759 */
2760 /*
2761 ** The input blob contains HTML. If safe-html is enabled, then
2762 ** convert the input into "safe HTML". The following modifications
2763 ** are made:
2764
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -2745,19 +2745,19 @@
2745 }
2746
2747 /*
2748 ** SETTING: safe-html width=8
2749 ** This setting controls whether or not unsafe HTML elements
2750 ** (such as SCRIPT or STYLE tags) are allowed in Markdown-formatted
2751 ** documents. Unsafe HTML is disabled by default. If this setting
2752 ** exists and is a string, then letters in that string can enable
2753 ** unsafe HTML in various contexts:
2754 **
2755 ** - b Unsafe HTML allowed in embedded documentation
2756 ** - f Unsafe HTML allowed in forum posts
2757 ** - t Unsafe HTML allowed in tickets
2758 ** - w Unsafe HTML allowed on wiki pages
2759 */
2760 /*
2761 ** The input blob contains HTML. If safe-html is enabled, then
2762 ** convert the input into "safe HTML". The following modifications
2763 ** are made:
2764

Keyboard Shortcuts

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