Diff
Not logged in

Differences From Artifact [a34135cd31]:

To Artifact [8e76b5189c]:


604
605
606
607
608
609
610
611

612
613
614
615
616
617
618
604
605
606
607
608
609
610

611
612
613
614
615
616
617
618







-
+







** 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] ){
    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>
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
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







-
+

+
+
-
-
+
+


-
+





-
+

-
+





+
+
+
+
+







          @ cmd_%s(aCommand[idx].zName)</a>, 
        }
      }
      @ 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, tests, cnt;
      int nCol, nRow, i, ignored, cnt, showTest;

      /* detect, if we show normal or test commands */
      showTest = ( zCmd  && !strncmp(zCmd,"test",4) );
      for( i=0,tests=0; i<count(aCommand); i++){
        if( strncmp(aCommand[i].zName,"test",4)==0 ) tests++;
      for( i=0,ignored=0; i<count(aCommand); i++){
        if( (strncmp(aCommand[i].zName,"test",4)==0) ^ showTest ) ignored++;
      }
      nCol = 4;
      nRow = (count(aCommand)-tests+nCol-1)/nCol;
      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;
          cnt=0;
        }
        if( strncmp(aCommand[i].zName,"test",4)==0 ) continue;
        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>
      }
      @ <hr/>fossil version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
    }
    style_footer();
}

/*
** Set the g.zBaseURL value to the full URL for the toplevel of