Commit 24d426d5 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add code to dump VSL descriptions in RST format

parent f41fbd19
......@@ -70,6 +70,40 @@ struct vev_base *mgt_evb;
int exit_status = 0;
struct vsb *vident;
/*--------------------------------------------------------------------*/
static void
mgt_sltm(const char *tag, const char *sdesc, const char *ldesc)
{
int i;
printf("\n%s\n", tag);
i = strlen(tag);
printf("%*.*s\n\n", i, i, "------------------------------------");
if (*ldesc != '\0')
printf("%s\n", ldesc);
else if (*sdesc != '\0')
printf("%s\n", sdesc);
else
printf("%s\n", "(description not yet written)");
}
static void
mgt_DumpRstVsl(void)
{
printf(
"\n.. The following is autogenerated output from "
"varnishd -x dumprstvsl\n\n");
#define SLTM(tag, sdesc, ldesc) mgt_sltm(#tag, sdesc, ldesc);
#include "tbl/vsl_tags.h"
#undef SLTM
}
/*--------------------------------------------------------------------*/
static void
build_vident(void)
{
......@@ -462,6 +496,10 @@ main(int argc, char * const *argv)
MCF_DumpRstParam();
exit (0);
}
if (!strcmp(optarg, "dumprstvsl")) {
mgt_DumpRstVsl();
exit (0);
}
usage();
break;
case 'w':
......
......@@ -2,3 +2,4 @@ varnishtest "Code coverage of VCL compiler and RSTdump"
shell "cd ${topbuild}/bin/varnishd && ./varnishd -b 127.0.0.1:80 -C -n ${tmpdir} > /dev/null 2>&1"
shell "cd ${topbuild}/bin/varnishd && ./varnishd -x dumprstparam > /dev/null 2>&1"
shell "cd ${topbuild}/bin/varnishd && ./varnishd -x dumprstvsl > /dev/null 2>&1"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment