Fossil

Check-in [01b3c9c1]
Login

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

Overview
Comment:Improvements to the "help" webpage.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:01b3c9c1a8f31327ae3822e64a57a74dbf7fd1cd
User & Date: drh 2010-12-25 23:55:56
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: ae76c787 user: drh tags: trunk
23:55
Improvements to the "help" webpage. check-in: 01b3c9c1 user: drh tags: trunk
11:45
Add the "quotes" document to the permuted index. check-in: 8bdd09e4 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/main.c.

682
683
684
685
686
687
688
689
690
691
692
693
694
695

696
697
698
699
700
701
702
...
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

/*
** 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 ){
      int rc, idx;
      char *z, *s, *d;

      @ <h1>%s(zCmd)</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( *s=='%' && strncmp(s, "%fossil", 7)==0 ){
	      s++;
	    }else{
	      *d++ = *s++;
	    }
	  }
	  *d = 0;
	  @ <pre>%s(z)</pre>


	  free(z);
	}
      }
      @ <hr/><a href="help">available commands</a> in fossil
      @ version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
    }else{
      int i;
      
      @ <h1>Available commands</h1>

      for(i=0; i<count(aCommand); i++){

        if( strncmp(aCommand[i].zName,"test",4)==0 ) continue;
        @ <kbd><a href="help?cmd=%s(aCommand[i].zName)">




        @ %s(aCommand[i].zName)</a></kbd>



      }
      @ <hr/>fossil version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC











    }
    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







|
|




|
>







 







|
>
>



<
<

|
|
|
>
|
>
|
<
>
>
>
>
|
>
>
>
|
<
>
>
>
>
>
>
>
>
>
>
>







682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
...
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( *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