Fossil SCM

integrated test commands into the reference

wolfgang 2010-10-08 19:03 wolfgangHelpCmd
Commit f3f7d9e53f7724cbccd70eb9b48c6489d1c71030
3 files changed +14 -7 +11 -6 +7 -1
+14 -7
--- src/main.c
+++ src/main.c
@@ -606,11 +606,11 @@
606606
*/
607607
void help_page(void){
608608
const char * zCmd = P("cmd");
609609
610610
style_header("Command line help %s%s",zCmd?" - ":"",zCmd?zCmd:"");
611
- if( zCmd && zCmd[0] ){
611
+ if( zCmd && zCmd[0] && strcmp(zCmd,"test") ){
612612
int rc, idx;
613613
614614
rc = name_search(zCmd, aCommand, count(aCommand), &idx);
615615
if( rc==1 ){
616616
@ <h1>unknown command: %s(zCmd)</h1>
@@ -687,30 +687,37 @@
687687
}
688688
@ see also the list of
689689
@ <a href="help">available commands</a> in fossil
690690
@ version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
691691
}else{
692
- int nCol, nRow, i, tests, cnt;
692
+ int nCol, nRow, i, ignored, cnt, showTest;
693693
694
- for( i=0,tests=0; i<count(aCommand); i++){
695
- if( strncmp(aCommand[i].zName,"test",4)==0 ) tests++;
694
+ /* detect, if we show normal or test commands */
695
+ showTest = ( zCmd && !strncmp(zCmd,"test",4) );
696
+ for( i=0,ignored=0; i<count(aCommand); i++){
697
+ if( (strncmp(aCommand[i].zName,"test",4)==0) ^ showTest ) ignored++;
696698
}
697699
nCol = 4;
698
- nRow = (count(aCommand)-tests+nCol-1)/nCol;
700
+ nRow = (count(aCommand)-ignored+nCol-1)/nCol;
699701
@ <h1>Available commands</h1>
700702
@ <table class="browser"><tr><td class="browser"><ul class="browser">
701703
for( i=cnt=0; i<count(aCommand); i++ ){
702704
if( cnt==nRow ){
703705
@ </ul></td><td class="browser"><ul class="browser">
704
- cnt=0;
706
+ cnt=0;
705707
}
706
- if( strncmp(aCommand[i].zName,"test",4)==0 ) continue;
708
+ if( (strncmp(aCommand[i].zName,"test",4)==0) ^ showTest ) continue;
707709
@ <li><kbd><a href="help?cmd=%s(aCommand[i].zName)">
708710
@ %s(aCommand[i].zName)</a></kbd></li>
709711
cnt++;
710712
}
711713
@ </ul></td></tr></table>
714
+ if( showTest ){
715
+ @ <a href="help">show standard commands</a>
716
+ }else{
717
+ @ <a class="hidden" href="help?cmd=test">show test commands</a>
718
+ }
712719
@ <hr/>fossil version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
713720
}
714721
style_footer();
715722
}
716723
717724
--- src/main.c
+++ src/main.c
@@ -606,11 +606,11 @@
606 */
607 void help_page(void){
608 const char * zCmd = P("cmd");
609
610 style_header("Command line help %s%s",zCmd?" - ":"",zCmd?zCmd:"");
611 if( zCmd && zCmd[0] ){
612 int rc, idx;
613
614 rc = name_search(zCmd, aCommand, count(aCommand), &idx);
615 if( rc==1 ){
616 @ <h1>unknown command: %s(zCmd)</h1>
@@ -687,30 +687,37 @@
687 }
688 @ see also the list of
689 @ <a href="help">available commands</a> in fossil
690 @ version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
691 }else{
692 int nCol, nRow, i, tests, cnt;
693
694 for( i=0,tests=0; i<count(aCommand); i++){
695 if( strncmp(aCommand[i].zName,"test",4)==0 ) tests++;
 
 
696 }
697 nCol = 4;
698 nRow = (count(aCommand)-tests+nCol-1)/nCol;
699 @ <h1>Available commands</h1>
700 @ <table class="browser"><tr><td class="browser"><ul class="browser">
701 for( i=cnt=0; i<count(aCommand); i++ ){
702 if( cnt==nRow ){
703 @ </ul></td><td class="browser"><ul class="browser">
704 cnt=0;
705 }
706 if( strncmp(aCommand[i].zName,"test",4)==0 ) continue;
707 @ <li><kbd><a href="help?cmd=%s(aCommand[i].zName)">
708 @ %s(aCommand[i].zName)</a></kbd></li>
709 cnt++;
710 }
711 @ </ul></td></tr></table>
 
 
 
 
 
712 @ <hr/>fossil version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
713 }
714 style_footer();
715 }
716
717
--- src/main.c
+++ src/main.c
@@ -606,11 +606,11 @@
606 */
607 void help_page(void){
608 const char * zCmd = P("cmd");
609
610 style_header("Command line help %s%s",zCmd?" - ":"",zCmd?zCmd:"");
611 if( zCmd && zCmd[0] && strcmp(zCmd,"test") ){
612 int rc, idx;
613
614 rc = name_search(zCmd, aCommand, count(aCommand), &idx);
615 if( rc==1 ){
616 @ <h1>unknown command: %s(zCmd)</h1>
@@ -687,30 +687,37 @@
687 }
688 @ see also the list of
689 @ <a href="help">available commands</a> in fossil
690 @ version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
691 }else{
692 int nCol, nRow, i, ignored, cnt, showTest;
693
694 /* detect, if we show normal or test commands */
695 showTest = ( zCmd && !strncmp(zCmd,"test",4) );
696 for( i=0,ignored=0; i<count(aCommand); i++){
697 if( (strncmp(aCommand[i].zName,"test",4)==0) ^ showTest ) ignored++;
698 }
699 nCol = 4;
700 nRow = (count(aCommand)-ignored+nCol-1)/nCol;
701 @ <h1>Available commands</h1>
702 @ <table class="browser"><tr><td class="browser"><ul class="browser">
703 for( i=cnt=0; i<count(aCommand); i++ ){
704 if( cnt==nRow ){
705 @ </ul></td><td class="browser"><ul class="browser">
706 cnt=0;
707 }
708 if( (strncmp(aCommand[i].zName,"test",4)==0) ^ showTest ) continue;
709 @ <li><kbd><a href="help?cmd=%s(aCommand[i].zName)">
710 @ %s(aCommand[i].zName)</a></kbd></li>
711 cnt++;
712 }
713 @ </ul></td></tr></table>
714 if( showTest ){
715 @ <a href="help">show standard commands</a>
716 }else{
717 @ <a class="hidden" href="help?cmd=test">show test commands</a>
718 }
719 @ <hr/>fossil version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
720 }
721 style_footer();
722 }
723
724
+11 -6
--- src/style.c
+++ src/style.c
@@ -730,10 +730,15 @@
730730
},
731731
{ "p.shunned",
732732
"format for artifact lines beeing shunned",
733733
@ color: blue;
734734
},
735
+ { "a.hidden",
736
+ "format for links, that should not be very visible",
737
+ @ font-size: xx-small;
738
+ @ color: #aaaaaa;
739
+ },
735740
{ 0,
736741
0,
737742
0
738743
}
739744
};
@@ -745,18 +750,18 @@
745750
int i;
746751
747752
for (i=0;cssDefaultList[i].elementClass;i++){
748753
if (cssDefaultList[i].elementClass[0]){
749754
cgi_printf("/* %s */\n%s {\n%s\n}\n\n",
750
- cssDefaultList[i].comment,
751
- cssDefaultList[i].elementClass,
752
- cssDefaultList[i].value
753
- );
755
+ cssDefaultList[i].comment,
756
+ cssDefaultList[i].elementClass,
757
+ cssDefaultList[i].value
758
+ );
754759
}else{
755760
cgi_printf("%s",
756
- cssDefaultList[i].value
757
- );
761
+ cssDefaultList[i].value
762
+ );
758763
}
759764
}
760765
}
761766
762767
/*
763768
--- src/style.c
+++ src/style.c
@@ -730,10 +730,15 @@
730 },
731 { "p.shunned",
732 "format for artifact lines beeing shunned",
733 @ color: blue;
734 },
 
 
 
 
 
735 { 0,
736 0,
737 0
738 }
739 };
@@ -745,18 +750,18 @@
745 int i;
746
747 for (i=0;cssDefaultList[i].elementClass;i++){
748 if (cssDefaultList[i].elementClass[0]){
749 cgi_printf("/* %s */\n%s {\n%s\n}\n\n",
750 cssDefaultList[i].comment,
751 cssDefaultList[i].elementClass,
752 cssDefaultList[i].value
753 );
754 }else{
755 cgi_printf("%s",
756 cssDefaultList[i].value
757 );
758 }
759 }
760 }
761
762 /*
763
--- src/style.c
+++ src/style.c
@@ -730,10 +730,15 @@
730 },
731 { "p.shunned",
732 "format for artifact lines beeing shunned",
733 @ color: blue;
734 },
735 { "a.hidden",
736 "format for links, that should not be very visible",
737 @ font-size: xx-small;
738 @ color: #aaaaaa;
739 },
740 { 0,
741 0,
742 0
743 }
744 };
@@ -745,18 +750,18 @@
750 int i;
751
752 for (i=0;cssDefaultList[i].elementClass;i++){
753 if (cssDefaultList[i].elementClass[0]){
754 cgi_printf("/* %s */\n%s {\n%s\n}\n\n",
755 cssDefaultList[i].comment,
756 cssDefaultList[i].elementClass,
757 cssDefaultList[i].value
758 );
759 }else{
760 cgi_printf("%s",
761 cssDefaultList[i].value
762 );
763 }
764 }
765 }
766
767 /*
768
--- www/reference.wiki
+++ www/reference.wiki
@@ -95,14 +95,20 @@
9595
used fossil build, because it uses the original command help, which is
9696
compiled into the binary.
9797
9898
Additional, in-depth information in the wiki part is not available for
9999
all commands.
100
-
101100
102101
There are several bits of <b>fossil</b> that are not addressed
103102
in the help for commands (special wiki directories, special users, etc.)
104103
so they are (currently) not addressed here. Clarity and brevity may be
105104
sacrificed for expediency at the authors indiscretion. All spelling and
106105
grammatical mistakes are somebody elses fault.<code> void * </code>
107106
prohibited where<code> __C_PLUS_PLUS__ </code>. Title and taxes extra.
108107
Not valid in Hooptigonia.
108
+
109
+ <h3>Testing fossil</h3>
110
+ There are several [/help?cmd=test|test commands] to test the
111
+ internals of fossil. These commands are listed on a special web page
112
+ [/help?cmd=test|help?cmd=test]. This page is the counter part of
113
+ <kbd><a href="/help?cmd=test-commands">fossil test-commands</a></kbd>.
114
+
109115
--- www/reference.wiki
+++ www/reference.wiki
@@ -95,14 +95,20 @@
95 used fossil build, because it uses the original command help, which is
96 compiled into the binary.
97
98 Additional, in-depth information in the wiki part is not available for
99 all commands.
100
101
102 There are several bits of <b>fossil</b> that are not addressed
103 in the help for commands (special wiki directories, special users, etc.)
104 so they are (currently) not addressed here. Clarity and brevity may be
105 sacrificed for expediency at the authors indiscretion. All spelling and
106 grammatical mistakes are somebody elses fault.<code> void * </code>
107 prohibited where<code> __C_PLUS_PLUS__ </code>. Title and taxes extra.
108 Not valid in Hooptigonia.
 
 
 
 
 
 
 
109
--- www/reference.wiki
+++ www/reference.wiki
@@ -95,14 +95,20 @@
95 used fossil build, because it uses the original command help, which is
96 compiled into the binary.
97
98 Additional, in-depth information in the wiki part is not available for
99 all commands.
 
100
101 There are several bits of <b>fossil</b> that are not addressed
102 in the help for commands (special wiki directories, special users, etc.)
103 so they are (currently) not addressed here. Clarity and brevity may be
104 sacrificed for expediency at the authors indiscretion. All spelling and
105 grammatical mistakes are somebody elses fault.<code> void * </code>
106 prohibited where<code> __C_PLUS_PLUS__ </code>. Title and taxes extra.
107 Not valid in Hooptigonia.
108
109 <h3>Testing fossil</h3>
110 There are several [/help?cmd=test|test commands] to test the
111 internals of fossil. These commands are listed on a special web page
112 [/help?cmd=test|help?cmd=test]. This page is the counter part of
113 <kbd><a href="/help?cmd=test-commands">fossil test-commands</a></kbd>.
114
115

Keyboard Shortcuts

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