Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Improvements to the "help" webpage. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
01b3c9c1a8f31327ae3822e64a57a74d |
| User & Date: | drh 2010-12-25 23:55:56.000 |
Context
|
2010-12-25
| ||
| 23:58 | All the help URL to have its command specified as a path extension in addition to the "cmd" query parameter. ... (check-in: ae76c7879b user: drh tags: trunk) | |
| 23:55 | Improvements to the "help" webpage. ... (check-in: 01b3c9c1a8 user: drh tags: trunk) | |
| 11:45 | Add the "quotes" document to the permuted index. ... (check-in: 8bdd09e409 user: drh tags: trunk) | |
Changes
Changes to src/main.c.
| ︙ | ︙ | |||
682 683 684 685 686 687 688 |
/*
** WEBPAGE: help
** URL: /help?cmd=CMD
*/
void help_page(void){
const char * zCmd = P("cmd");
| | | > | > > | < < | | | > | > | > > > | | > > > | < > > > > > > > > > > > | 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 |
/*
** WEBPAGE: help
** URL: /help?cmd=CMD
*/
void help_page(void){
const char * zCmd = P("cmd");
style_header("Command-line Help");
if( zCmd ){
int rc, idx;
char *z, *s, *d;
style_submenu_element("Command-List", "Command-List", "%s/help", g.zTop);
@ <h1>The "%s(zCmd)" command:</h1>
rc = name_search(zCmd, aCommand, count(aCommand), &idx);
if( rc==1 ){
@ unknown command: %s(zCmd)
}else if( rc==2 ){
@ ambiguous command prefix: %s(zCmd)
}else{
z = (char*)aCmdHelp[idx];
if( z==0 ){
@ no help available for the %s(aCommand[idx].zName) command
}else{
z=s=d=mprintf("%s",z);
while( *s ){
if( *s=='%' && strncmp(s, "%fossil", 7)==0 ){
s++;
}else{
*d++ = *s++;
}
}
*d = 0;
@ <blockquote><pre>
@ %h(z)
@ </pre></blockquote>
free(z);
}
}
}else{
int i, j, n;
@ <h1>Available commands:</h1>
@ <table border="0"><tr>
for(i=j=0; i<count(aCommand); i++){
const char *z = aCommand[i].zName;
if( strncmp(z,"test",4)==0 ) continue;
j++;
}
n = (j+6)/7;
for(i=j=0; i<count(aCommand); i++){
const char *z = aCommand[i].zName;
if( strncmp(z,"test",4)==0 ) continue;
if( j==0 ){
@ <td valign="top"><ul>
}
@ <li><a href="%s(g.zTop)/help?cmd=%s(z)">%s(z)</a>
j++;
if( j>=n ){
@ </ul></td>
j = 0;
}
}
if( j>0 ){
@ </ul></td>
}
@ </tr></table>
}
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
|
| ︙ | ︙ |