3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2004, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
33 * GROningen Mixture of Alchemy and Childrens' Stories
43 #include "gromacs/commandline/cmdlinehelpcontext.h"
44 #include "gromacs/onlinehelp/wman.h"
45 #include "gromacs/utility/exceptions.h"
46 #include "gromacs/utility/file.h"
47 #include "gromacs/utility/stringutil.h"
49 #include "gmx_fatal.h"
60 /* The source code in this file should be thread-safe.
61 Please keep it that way. */
65 const char *search, *replace;
69 char *search, *replace;
72 /* The order of these arrays is significant. Text search and replace
73 * for each element occurs in order, so earlier changes can induce
74 * subsequent changes even though the original text might not appear
75 * to invoke the latter changes. */
77 const t_sandr_const sandrTeX[] = {
85 /* Escaping underscore for LaTeX is no longer necessary, and it breaks
86 * text searching and the index if you do. */
91 { "<=", "\\ensuremath{\\leq{}}"},
92 { ">=", "\\ensuremath{\\geq{}}"},
93 { "<", "\\textless{}" },
94 { ">", "\\textgreater{}" },
96 { "\\^{}t", "\\ensuremath{^t}" },
97 { "\\^{}a", "\\ensuremath{^a}" },
98 { "\\^{}b", "\\ensuremath{^b}" },
99 { "\\^{}2", "\\ensuremath{^2}" },
100 { "\\^{}3", "\\ensuremath{^3}" },
101 { "\\^{}6", "\\ensuremath{^6}" },
106 /* The next couple of lines allow true Greek symbols to be written to the
107 manual, which makes it look pretty */
108 { "[GRK]", "\\ensuremath{\\" },
110 { "[MATH]", "\\ensuremath{" },
112 { "[CHEVRON]", "\\ensuremath{<}" },
113 { "[chevron]", "\\ensuremath{>}" },
114 { "[MAG]", "\\ensuremath{|}" },
115 { "[mag]", "\\ensuremath{|}" },
116 { "[INT]", "\\ensuremath{\\int" },
122 { "[SUM]", "\\ensuremath{\\sum" },
124 { "[SUB]", "\\ensuremath{_{" },
126 { "[SQRT]", "\\ensuremath{\\sqrt{" },
128 { "[EXP]", "\\ensuremath{\\exp{(" },
130 { "[LN]", "\\ensuremath{\\ln{(" },
132 { "[LOG]", "\\ensuremath{\\log{(" },
134 { "[COS]", "\\ensuremath{\\cos{(" },
136 { "[SIN]", "\\ensuremath{\\sin{(" },
138 { "[TAN]", "\\ensuremath{\\tan{(" },
140 { "[COSH]", "\\ensuremath{\\cosh{(" },
142 { "[SINH]", "\\ensuremath{\\sinh{(" },
144 { "[TANH]", "\\ensuremath{\\tanh{(" },
147 #define NSRTEX asize(sandrTeX)
149 const t_sandr_const sandrTty[] = {
158 { "[CHEVRON]", "<" },
159 { "[chevron]", ">" },
162 { "[INT]", "integral" },
163 { "[FROM]", " from " },
172 { "[SQRT]", "sqrt(" },
186 { "[COSH]", "cosh(" },
188 { "[SINH]", "sinh(" },
190 { "[TANH]", "tanh(" },
197 #define NSRTTY asize(sandrTty)
199 const t_sandr_const sandrNROFF[] = {
208 { "[CHEVRON]", "<" },
209 { "[chevron]", ">" },
212 { "[INT]", "integral" },
213 { "[FROM]", " from " },
222 { "[SQRT]", "sqrt(" },
236 { "[COSH]", "cosh(" },
238 { "[SINH]", "sinh(" },
240 { "[TANH]", "tanh(" },
253 #define NSRNROFF asize(sandrNROFF)
255 const t_sandr_const sandrHTML[] = {
266 { "[CHEVRON]", "<" },
267 { "[chevron]", ">" },
270 { "[INT]", "integral" },
271 { "[FROM]", " from " },
280 { "[SQRT]", "sqrt(" },
294 { "[COSH]", "cosh(" },
296 { "[SINH]", "sinh(" },
298 { "[TANH]", "tanh(" },
305 #define NSRHTML asize(sandrHTML)
308 static char *mydate(char buf[], int maxsize)
310 const char *mon[] = {
311 "Jan", "Feb", "Mar", "Apr", "May", "Jun",
312 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
314 const char *day[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
319 #ifdef GMX_NATIVE_WINDOWS
321 localtime_s(&tm, &now);
323 localtime_r(&now, &tm);
326 sprintf(buf, "%s %d %s %d", day[tm.tm_wday], tm.tm_mday,
327 mon[tm.tm_mon], tm.tm_year+1900);
332 /* Data structure for saved HTML links */
333 typedef struct t_linkdata {
338 static t_linkdata *init_linkdata()
348 static void finish_linkdata(t_linkdata *p)
352 for (i = 0; i < p->nsr; i++)
354 sfree(p->sr[i].search);
355 sfree(p->sr[i].replace);
361 static char *repall(const char *s, int nsr, const t_sandr_const sa[])
365 std::string result(s);
366 for (int i = 0; i < nsr; ++i)
368 result = gmx::replaceAll(result, sa[i].search, sa[i].replace);
370 return gmx_strdup(result.c_str());
372 GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
375 static char *repallww(const char *s, int nsr, const t_sandr sa[])
379 std::string result(s);
380 for (int i = 0; i < nsr; ++i)
382 result = gmx::replaceAllWords(result, sa[i].search, sa[i].replace);
384 return gmx_strdup(result.c_str());
386 GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
389 static char *html_xref(char *s, const char *program, t_linkdata *links)
391 char buf[256], **filestr;
394 if (links->sr == NULL)
396 n = get_file("links.dat", &(filestr));
399 for (i = 0, j = 0; (i < n); i++)
401 if (!program || (gmx_strcasecmp(program, filestr[i]) != 0))
403 links->sr[j].search = gmx_strdup(filestr[i]);
404 sprintf(buf, "<a href=\"%s.html\">%s</a>", filestr[i], filestr[i]);
405 links->sr[j].replace = gmx_strdup(buf);
410 for (i = 0; i < n; i++)
416 return repallww(s, links->nsr, links->sr);
419 char *check_tex(const char *s)
421 return repall(s, NSRTEX, sandrTeX);
424 static char *check_nroff(const char *s)
426 return repall(s, NSRNROFF, sandrNROFF);
429 static char *check_html(const char *s, const char *program, t_linkdata *links)
433 buf = repall(s, NSRHTML, sandrHTML);
434 buf = html_xref(buf, program, links);
439 #define NSR(s) check_html(s, program, links)
441 #define FLAG_SET(flag, mask) ((flag &mask) == mask)
442 char *fileopt(unsigned long flag, char buf[], int maxsize)
446 if (FLAG_SET(flag, ffRW))
448 sprintf(tmp, "In/Out");
450 else if (FLAG_SET(flag, ffREAD))
452 sprintf(tmp, "Input");
454 else if (FLAG_SET(flag, ffWRITE))
456 sprintf(tmp, "Output");
460 sprintf(tmp, "Dunno");
463 if (FLAG_SET(flag, ffOPT))
465 strcat(tmp, ", Opt");
466 if (FLAG_SET(flag, ffSET))
475 if (FLAG_SET(flag, ffLIB))
477 strcat(tmp, ", Lib.");
479 if (FLAG_SET(flag, ffMULT))
481 strcat(tmp, ", Mult.");
484 sprintf(buf, "%s", tmp);
489 static void write_texman(FILE *out, const char *program,
490 int nldesc, const char **desc,
491 int nfile, t_filenm *fnm,
492 int npargs, t_pargs *pa,
493 int nbug, const char **bugs,
499 fprintf(out, "\\section{\\normindex{%s}}\\label{%s}\n\n", check_tex(program), check_tex(program));
503 for (i = 0; (i < nldesc); i++)
505 fprintf(out, "%s\n", check_tex(desc[i]));
511 fprintf(out, "\\vspace{-2ex}\\begin{tabbing}\n");
512 fprintf(out, "\n{\\normalsize \\bf Files}\\nopagebreak\\\\\n");
513 fprintf(out, "{\\tt ~~~~~~~} \\= {\\tt ~~~~~~~~~~~~~~} \\= "
514 "~~~~~~~~~~~~~~~~~~~~~~ \\= \\nopagebreak\\kill\n");
515 for (i = 0; (i < nfile); i++)
517 fprintf(out, "\\>{\\tt %s} \\'\\> {\\tt %s} \\' %s \\> "
518 "\\parbox[t]{0.55\\linewidth}{%s} \\\\\n",
519 check_tex(fnm[i].opt), check_tex(fnm[i].fns[0]),
520 check_tex(fileopt(fnm[i].flag, tmp, 255)),
521 check_tex(ftp2desc(fnm[i].ftp)));
523 fprintf(out, "\\end{tabbing}\\vspace{-4ex}\n");
527 fprintf(out, "\\vspace{-2ex}\\begin{tabbing}\n");
528 fprintf(out, "\n{\\normalsize \\bf Other options}\\nopagebreak\\\\\n");
529 fprintf(out, "{\\tt ~~~~~~~~~~} \\= vector \\= "
530 "{\\tt ~~~~~~~} \\= \\nopagebreak\\kill\n");
531 for (i = 0; (i < npargs); i++)
533 if (strlen(check_tex(pa_val(&(pa[i]), tmp, 255))) <= 8)
535 fprintf(out, "\\> {\\tt %s} \\'\\> %s \\'\\> {\\tt %s} \\' "
536 "\\parbox[t]{0.68\\linewidth}{%s}\\\\\n",
537 check_tex(pa[i].option), get_arg_desc(pa[i].type),
538 check_tex(pa_val(&(pa[i]), tmp, 255)),
539 check_tex(pa[i].desc));
543 fprintf(out, "\\> {\\tt %s} \\'\\> %s \\'\\>\\\\\n"
544 "\\> \\'\\> \\'\\> {\\tt %s} \\' "
545 "\\parbox[t]{0.7\\linewidth}{%s}\\\\\n",
546 check_tex(pa[i].option), get_arg_desc(pa[i].type),
547 check_tex(pa_val(&(pa[i]), tmp, 255)),
548 check_tex(pa[i].desc));
551 fprintf(out, "\\end{tabbing}\\vspace{-4ex}\n");
556 fprintf(out, "\\begin{itemize}\n");
557 for (i = 0; (i < nbug); i++)
559 fprintf(out, "\\item %s\n", check_tex(bugs[i]));
561 fprintf(out, "\\end{itemize}\n");
563 /* fprintf(out,"\n\\newpage\n"); */
566 static void write_nroffman(FILE *out,
568 int nldesc, const char **desc,
569 int nfile, t_filenm *fnm,
570 int npargs, t_pargs *pa,
571 int nbug, const char **bugs,
578 fprintf(out, ".SH SYNOPSIS\n");
579 fprintf(out, "\\f3%s\\fP\n", program);
581 /* command line arguments */
584 for (i = 0; (i < nfile); i++)
586 fprintf(out, ".BI \"%s\" \" %s \"\n", check_nroff(fnm[i].opt),
587 check_nroff(fnm[i].fns[0]));
592 for (i = 0; (i < npargs); i++)
594 if (pa[i].type == etBOOL)
596 fprintf(out, ".BI \"\\-[no]%s\" \"\"\n", check_nroff(pa[i].option+1));
600 fprintf(out, ".BI \"%s\" \" %s \"\n", check_nroff(pa[i].option),
601 check_nroff(get_arg_desc(pa[i].type)));
609 fprintf(out, ".SH DESCRIPTION\n");
610 for (i = 0; (i < nldesc); i++)
612 fprintf(out, "\\&%s\n", check_nroff(desc[i]));
619 fprintf(out, ".SH FILES\n");
620 for (i = 0; (i < nfile); i++)
622 fprintf(out, ".BI \"%s\" \" %s\" \n.B %s\n %s \n\n",
623 check_nroff(fnm[i].opt),
624 check_nroff(fnm[i].fns[0]),
625 check_nroff(fileopt(fnm[i].flag, tmp, 255)),
626 check_nroff(ftp2desc(fnm[i].ftp)));
631 fprintf(out, ".SH OTHER OPTIONS\n");
634 for (i = 0; (i < npargs); i++)
636 if (pa[i].type == etBOOL)
638 fprintf(out, ".BI \"\\-[no]%s\" \"%s\"\n %s\n\n",
639 check_nroff(pa[i].option+1),
640 check_nroff(pa_val(&(pa[i]), tmp, 255)),
641 check_nroff(pa[i].desc));
645 fprintf(out, ".BI \"%s\" \" %s\" \" %s\" \n %s\n\n",
646 check_nroff(pa[i].option),
647 check_nroff(get_arg_desc(pa[i].type)),
648 check_nroff(pa_val(&(pa[i]), tmp, 255)),
649 check_nroff(pa[i].desc));
656 fprintf(out, ".SH KNOWN PROBLEMS\n");
657 for (i = 0; (i < nbug); i++)
659 fprintf(out, "\\- %s\n\n", check_nroff(bugs[i]));
664 char *check_tty(const char *s)
666 return repall(s, NSRTTY, sandrTty);
670 print_tty_formatted(FILE *out, int nldesc, const char **desc, int indent,
671 t_linkdata *links, const char *program)
679 for (i = 0; (i < nldesc); i++)
681 if ((strlen(buf) > 0) &&
682 (buf[strlen(buf)-1] != ' ') && (buf[strlen(buf)-1] != '\n'))
686 temp = check_tty(desc[i]);
687 if (strlen(buf) + strlen(temp) >= (size_t)(buflen-2))
689 buflen += strlen(temp);
695 /* Make lines of at most 79 characters */
696 temp = wrap_lines(buf, 78, indent, FALSE);
697 fprintf(out, "%s\n", temp);
702 static void write_ttyman(FILE *out,
704 int nldesc, const char **desc,
705 int nfile, t_filenm *fnm,
706 int npargs, t_pargs *pa,
707 int nbug, const char **bugs,
715 fprintf(out, "DESCRIPTION\n-----------\n");
716 print_tty_formatted(out, nldesc, desc, 0, links, program);
721 fprintf(out, "KNOWN PROBLEMS\n----------\n");
722 for (i = 0; i < nbug; i++)
724 snew(tmp, strlen(bugs[i])+3);
726 strcpy(tmp+2, check_tty(bugs[i]));
727 fprintf(out, "%s\n", wrap_lines(tmp, 78, 2, FALSE));
734 pr_fns(out, nfile, fnm);
738 print_pargs(out, npargs, pa);
742 static void pr_html_files(FILE *out, int nfile, t_filenm fnm[],
743 const char *program, t_linkdata *links)
746 char link[10], tmp[255];
749 "<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2>\n"
754 "<TH>description</TH>"
757 for (i = 0; (i < nfile); i++)
759 strcpy(link, ftp2ext(fnm[i].ftp));
760 if (strcmp(link, "???") == 0)
762 strcpy(link, "files");
766 "<TD ALIGN=RIGHT> <b><tt>%s</tt></b> </TD>"
767 "<TD ALIGN=RIGHT> <tt><a href=\"%s.html\">%12s</a></tt> </TD>"
771 fnm[i].opt, link, fnm[i].fns[0], fileopt(fnm[i].flag, tmp, 255),
772 NSR(ftp2desc(fnm[i].ftp)));
775 fprintf(out, "</TABLE>\n");
778 static void write_htmlman(FILE *out,
780 int nldesc, const char **desc,
781 int nfile, t_filenm *fnm,
782 int npargs, t_pargs *pa,
783 int nbug, const char **bugs,
789 fprintf(out, "<HTML>\n<HEAD>\n<TITLE>%s</TITLE>\n", program);
790 fprintf(out, "<LINK rel=stylesheet href=\"style.css\" type=\"text/css\">\n");
791 fprintf(out, "<BODY text=\"#000000\" bgcolor=\"#FFFFFF\" link=\"#0000FF\" vlink=\"#990000\" alink=\"#FF0000\">\n");
792 fprintf(out, "<TABLE WIDTH=\"98%%\" NOBORDER >\n<TR><TD WIDTH=400>\n");
793 fprintf(out, "<TABLE WIDTH=400 NOBORDER>\n<TD WIDTH=116>\n");
794 fprintf(out, "<a href=\"http://www.gromacs.org/\">"
795 "<img SRC=\"../images/gmxlogo_small.png\""
796 "BORDER=0 </a></td>\n");
797 fprintf(out, "<td ALIGN=LEFT VALIGN=TOP WIDTH=280>"
798 "<br><h2>%s</h2>", program);
799 fprintf(out, "<font size=-1><A HREF=\"../online.html\">Main Table of Contents</A></font><br>");
800 fprintf(out, "<br></td>\n</TABLE></TD><TD WIDTH=\"*\" ALIGN=RIGHT VALIGN=BOTTOM><p><B>%s<br>\n", GromacsVersion());
801 fprintf(out, "%s</B></td></tr></TABLE>\n<HR>\n", mydate(tmp, 255));
805 fprintf(out, "<H3>Description</H3>\n<p>\n");
806 for (i = 0; (i < nldesc); i++)
808 fprintf(out, "%s\n", NSR(desc[i]));
813 fprintf(out, "<P>\n");
814 fprintf(out, "<H3>Files</H3>\n");
815 pr_html_files(out, nfile, fnm, program, links);
819 fprintf(out, "<P>\n");
820 fprintf(out, "<H3>Other options</H3>\n");
822 "<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2>\n"
827 "<TH>description</TH>"
829 for (i = 0; (i < npargs); i++)
833 "<TD ALIGN=RIGHT> <b><tt>%s%s</tt></b> </TD>"
834 "<TD ALIGN=RIGHT> %s </TD>"
835 "<TD ALIGN=RIGHT> <tt>%s</tt> </TD>"
838 (pa[i].type == etBOOL) ? "-[no]" : "-", pa[i].option+1,
839 get_arg_desc(pa[i].type), pa_val(&(pa[i]), tmp, 255), NSR(pa[i].desc));
841 fprintf(out, "</TABLE>\n");
845 fprintf(out, "<P>\n");
846 fprintf(out, "<H3>Known problems</H3>\n");
847 fprintf(out, "<UL>\n");
848 for (i = 0; (i < nbug); i++)
850 fprintf(out, "<LI>%s\n", NSR(bugs[i]));
852 fprintf(out, "</UL>\n");
854 fprintf(out, "<P>\n");
855 fprintf(out, "<hr>\n<div ALIGN=RIGHT>\n");
856 fprintf(out, "<font size=\"-1\"><a href=\"http://www.gromacs.org\">"
857 "http://www.gromacs.org</a></font><br>\n");
858 fprintf(out, "<font size=\"-1\"><a href=\"mailto:gromacs@gromacs.org\">"
859 "gromacs@gromacs.org</a></font><br>\n");
860 fprintf(out, "</div>\n");
861 fprintf(out, "</BODY>\n");
864 static void pr_opts(FILE *fp,
865 int nfile, t_filenm *fnm,
866 int npargs, t_pargs pa[], int shell)
873 fprintf(fp, " \"c/-/(");
874 for (i = 0; i < nfile; i++)
876 fprintf(fp, " %s", fnm[i].opt+1);
878 for (i = 0; i < npargs; i++)
880 if ( (pa[i].type == etBOOL) && *(pa[i].u.b) )
882 fprintf(fp, " no%s", pa[i].option+1);
886 fprintf(fp, " %s", pa[i].option+1);
892 fprintf(fp, "if (( $COMP_CWORD <= 1 )) || [[ $c == -* ]]; then COMPREPLY=( $(compgen -W '");
893 for (i = 0; i < nfile; i++)
895 fprintf(fp, " -%s", fnm[i].opt+1);
897 for (i = 0; i < npargs; i++)
899 if ( (pa[i].type == etBOOL) && *(pa[i].u.b) )
901 fprintf(fp, " -no%s", pa[i].option+1);
905 fprintf(fp, " -%s", pa[i].option+1);
908 fprintf(fp, "' -- $c)); return 0; fi\n");
911 fprintf(fp, " -x 's[-]' -s \"");
912 for (i = 0; i < nfile; i++)
914 fprintf(fp, " %s", fnm[i].opt+1);
916 for (i = 0; i < npargs; i++)
918 if ( (pa[i].type == etBOOL) && *(pa[i].u.b) )
920 fprintf(fp, " no%s", pa[i].option+1);
924 fprintf(fp, " %s", pa[i].option+1);
932 static void write_cshcompl(FILE *out,
933 int nfile, t_filenm *fnm,
934 int npargs, t_pargs *pa)
936 fprintf(out, "complete %s", ShortProgram());
937 pr_enums(out, npargs, pa, eshellCSH);
938 pr_fopts(out, nfile, fnm, eshellCSH);
939 pr_opts(out, nfile, fnm, npargs, pa, eshellCSH);
943 static void write_zshcompl(FILE *out,
944 int nfile, t_filenm *fnm,
945 int npargs, t_pargs *pa)
947 fprintf(out, "compctl ");
949 /* start with options, since they are always present */
950 pr_opts(out, nfile, fnm, npargs, pa, eshellZSH);
951 pr_enums(out, npargs, pa, eshellZSH);
952 pr_fopts(out, nfile, fnm, eshellZSH);
953 fprintf(out, "-- %s\n", ShortProgram());
956 static void write_bashcompl(FILE *out,
957 int nfile, t_filenm *fnm,
958 int npargs, t_pargs *pa)
960 /* Advanced bash completions are handled by shell functions.
961 * p and c hold the previous and current word on the command line.
962 * We need to use extended globbing, so write it in each completion file */
963 fprintf(out, "shopt -s extglob\n");
964 fprintf(out, "_%s_compl() {\nlocal p c\n", ShortProgram());
965 fprintf(out, "COMPREPLY=() c=${COMP_WORDS[COMP_CWORD]} p=${COMP_WORDS[COMP_CWORD-1]}\n");
966 pr_opts(out, nfile, fnm, npargs, pa, eshellBASH);
967 fprintf(out, "case \"$p\" in\n");
969 pr_enums(out, npargs, pa, eshellBASH);
970 pr_fopts(out, nfile, fnm, eshellBASH);
971 fprintf(out, "esac }\ncomplete -F _%s_compl %s\n", ShortProgram(), ShortProgram());
974 void write_man(const char *mantp,
976 int nldesc, const char **desc,
977 int nfile, t_filenm *fnm,
978 int npargs, t_pargs *pa,
979 int nbug, const char **bugs)
981 bool bHidden = false;
987 links = init_linkdata();
989 const gmx::CommandLineHelpContext *context
990 = gmx::GlobalCommandLineHelpContext::get();
991 bool bFileOpened = false;
995 out = context->writerContext().outputFile().handle();
996 bHidden = context->showHidden();
1001 sprintf(buf, "%s.%s", program, mantp);
1002 out = gmx_fio_fopen(buf, "w");
1015 for (int i = 0; i < npargs; i++)
1017 if (!is_hidden(&pa[i]))
1025 if (strcmp(mantp, "tex") == 0)
1027 write_texman(out, program, nldesc, desc, nfile, fnm, npar, par, nbug, bugs, links);
1029 if (strcmp(mantp, "nroff") == 0)
1031 write_nroffman(out, context->moduleDisplayName(), nldesc, desc,
1032 nfile, fnm, npar, par, nbug, bugs, links);
1034 if (strcmp(mantp, "help") == 0)
1036 write_ttyman(out, program, nldesc, desc, nfile, fnm, npar, par, nbug, bugs, links);
1038 if (strcmp(mantp, "html") == 0)
1040 write_htmlman(out, program, nldesc, desc, nfile, fnm, npar, par, nbug, bugs, links);
1042 if (strcmp(mantp, "completion-zsh") == 0)
1044 write_zshcompl(out, nfile, fnm, npar, par);
1046 if (strcmp(mantp, "completion-bash") == 0)
1048 write_bashcompl(out, nfile, fnm, npar, par);
1050 if (strcmp(mantp, "completion-csh") == 0)
1052 write_cshcompl(out, nfile, fnm, npar, par);
1057 gmx_fio_fclose(out);
1065 finish_linkdata(links);
1068 const char *get_arg_desc(int type)
1070 static const char *argtp[etNR] = {
1071 "int", "step", "real", "time", "string", "bool", "vector", "enum"