Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Cleanup of help_page() in preparation for merging with trunk. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | StvPrivateHook2 |
| Files: | files | file ages | folders |
| SHA1: |
a298a0e2f95c001a38f73a907f1f401a |
| User & Date: | drh 2010-11-09 01:17:07.000 |
Context
|
2010-11-09
| ||
| 01:17 | Cleanup of help_page() in preparation for merging with trunk. ... (Closed-Leaf check-in: a298a0e2f9 user: drh tags: StvPrivateHook2) | |
|
2010-11-08
| ||
| 23:01 | remove hook command to be compatible with other hook designs ... (check-in: a06121740a user: wolfgang tags: StvPrivateHook2) | |
Changes
Changes to src/main.c.
| ︙ | ︙ | |||
655 656 657 658 659 660 661 |
}
/*
** WEBPAGE: help
** URL: /help?cmd=CMD
*/
void help_page(void){
| | | | | | | | | | | | | | > | < | | | < | > | | | | > | < | < < < | > | < < < < < < < < < < | | > | < < | | | | | | < > | | | < < < < < < < < | | < < | < < < | > > > > | | | | < > | < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | | | 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 |
}
/*
** WEBPAGE: help
** URL: /help?cmd=CMD
*/
void help_page(void){
const char * zCmd = P("cmd");
style_header("Command line help %s%s",zCmd?" - ":"",zCmd?zCmd:"");
if( zCmd && zCmd[0] && strcmp(zCmd,"test") ){
int rc, idx;
rc = name_search(zCmd, aCommand, count(aCommand), &idx);
if( rc==1 ){
@ <h1>unknown command: %s(zCmd)</h1>
}else if( rc==2 ){
@ <h1>ambiguous command prefix: %s(zCmd)</h1>
}else{
const char *zHelp;
int i;
zHelp = aCmdHelp[idx];
@ <h1>%s(aCommand[idx].zName)</h1>
if( zHelp==0 || zHelp[0]==0 ){
@ no help available for the %s(aCommand[idx].zName) command
}else{
int c;
@ <div class="cmdhelp">
for(i=0; (c = zHelp[i])!=0; i++){
if( c=='%' && memcmp(zHelp+i, "%fossil", 7)==0 ){
/* Skip over the "%" */
cgi_append_content(zHelp, i);
i++;
zHelp += i;
i = 0;
}else if( c=='<' && memcmp(zHelp+i, "</a>", 3)==0 ){
cgi_append_content(zHelp, i+4);
zHelp += i+4;
i = -1;
cgi_append_content("\"", 1);
}else if( c=='<' && memcmp(zHelp+i, "<a ", 3)==0 ){
cgi_append_content(zHelp, i);
cgi_append_content("\"", 1);
zHelp += i;
i = 0;
}else if( c=='<' && strncmp(zHelp+i, "<a>", 3)==0 ){
/* found an internal command cross reference,
** create an additional link
*/
cgi_append_content(zHelp, i);
cgi_append_content("\"<a href=\"help?cmd=", -1);
zHelp += i+3;
i = 0;
while( zHelp[i] && memcmp(zHelp+i,"</a>",4)!=0 ){
i++;
}
cgi_append_content(zHelp, i);
cgi_append_content("\">", -1);
cgi_append_content(zHelp, i);
cgi_append_content("</a>\"", -1);
zHelp += i+4;
i = -1;
}
}
cgi_append_content(zHelp, i);
@ </div>
}
}
@ see also the list of
@ <a href="help">available commands</a> in fossil
@ version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
}else{
int nCol, nRow, i, ignored, cnt, showTest;
/* detect, if we show normal or test commands */
showTest = ( zCmd && !strncmp(zCmd,"test",4) );
for( i=0,ignored=0; i<count(aCommand); i++){
if( (strncmp(aCommand[i].zName,"test",4)==0) ^ showTest ) ignored++;
}
nCol = 4;
nRow = (count(aCommand)-ignored+nCol-1)/nCol;
@ <h1>Available commands</h1>
@ <table class="browser"><tr><td class="browser"><ul class="browser">
for( i=cnt=0; i<count(aCommand); i++ ){
if( cnt==nRow ){
@ </ul></td><td class="browser"><ul class="browser">
cnt=0;
}
if( (strncmp(aCommand[i].zName,"test",4)==0) ^ showTest ) continue;
@ <li><kbd><a href="help?cmd=%s(aCommand[i].zName)">
@ %s(aCommand[i].zName)</a></kbd></li>
cnt++;
}
@ </ul></td></tr></table>
if( showTest ){
@ <a href="help">show standard commands</a>
}else{
@ <a class="hidden" href="help?cmd=test">show test commands</a>
}
}
style_footer();
}
/*
** Set the g.zBaseURL value to the full URL for the toplevel of
** the fossil tree. Set g.zTop to g.zBaseURL without the
** leading "http://" and the host and port.
*/
|
| ︙ | ︙ |