Diff
Not logged in

Differences From Artifact [b95cbf4aff]:

To Artifact [7bb0cacd78]:


604
605
606
607
608
609
610
611

612
613
614
615
616
617

618
619
620

621
622
623
624
625
626
627
604
605
606
607
608
609
610

611
612
613
614
615


616
617


618
619
620
621
622
623
624
625







-
+




-
-
+

-
-
+







** 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 ){
    if( zCmd  && zCmd[0] ){
      int rc, idx;

      rc = name_search(zCmd, aCommand, count(aCommand), &idx);
      if( rc==1 ){
        @ <h1>%s(zCmd)</h1>
        @ unknown command: %s(zCmd)
        @ <h1>unknown command: %s(zCmd)</h1>
      }else if( rc==2 ){
        @ <h1>%s(zCmd)</h1>
        @ ambiguous command prefix: %s(zCmd)
        @ <h1>ambiguous command prefix: %s(zCmd)</h1>
      }else{
        char *zSrc, *zDest;
        int src,dest,len;

        @ <h1>%s(aCommand[idx].zName)</h1>
        zSrc = (char*)aCmdHelp[idx];
        if( zSrc==0 || *zSrc==0 ){
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
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







+



+







-
-
-
-
-
+
+
+
+
+
+







              zDest[dest++]='=';
              start = src+1;
              for( src=start; zSrc[src] && zSrc[src]!='<'; ){
                zDest[dest++]=zSrc[src++]; /* command name */
              }
              zDest[dest++]='"';
              zDest[dest++]='>';
              zDest[dest++]='"';
              for( src=start; zSrc[src] && zSrc[src]!='<'; ){
                zDest[dest++]=zSrc[src++]; /* command name */
              }
              zDest[dest++]='"';
            }else{
              zDest[dest++] = zSrc[src++];
            }
          }
          zDest[dest] = 0;
          @ <pre>%s(zDest)</pre>
          free(zDest);
        }
      }
      @ <hr>additional information may be found in the web documentation:
      @ <a href="http://www.fossil-scm.org/fossil/doc/tip/www/cmd_%s(aCommand[idx].zName).wiki">
      @ cmd_%s(aCommand[idx].zName)</a>, see also the list of
          @ <hr>additional information may be found in the web documentation:
          @ <a href="http://www.fossil-scm.org/fossil/doc/tip/www/cmd_%s(aCommand[idx].zName).wiki">
          @ 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;

      for( i=0,tests=0; i<count(aCommand); i++){
        if( strncmp(aCommand[i].zName,"test",4)==0 ) tests++;