Commit 64cb7b67 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

Generate the varnishstat(1) key bindings section

It should currently result in 1:1 RST code, and might be output slightly
differently to accomodate a help screen, without changing the semantic
of the RST code.
parent 8106bbe1
......@@ -257,6 +257,18 @@ usage(int status)
exit(status);
}
static int
key_bindings(void)
{
#define BINDING_KEY(chr, name, next) \
printf("<%s>" next, name);
#define BINDING(name, desc) \
printf("\n%s\n\n", desc);
#include "varnishstat_bindings.h"
return (0);
}
int
main(int argc, char * const *argv)
{
......@@ -267,6 +279,9 @@ main(int argc, char * const *argv)
int has_f = 0;
struct vsc *vsc;
if (argc == 2 && !strcmp(argv[1], "--bindings"))
exit(key_bindings());
vut = VUT_InitProg(argc, argv, &vopt_spec);
AN(vut);
vd = VSM_New();
......
......@@ -187,8 +187,12 @@ include/varnishstat_options.rst: $(top_builddir)/bin/varnishstat/varnishstat
include/varnishstat_synopsis.rst: $(top_builddir)/bin/varnishstat/varnishstat
$(top_builddir)/bin/varnishstat/varnishstat --synopsis > ${@}_
mv ${@}_ ${@}
include/varnishstat_bindings.rst: $(top_builddir)/bin/varnishstat/varnishstat
$(top_builddir)/bin/varnishstat/varnishstat --bindings > ${@}_
mv ${@}_ ${@}
BUILT_SOURCES += include/varnishstat_options.rst \
include/varnishstat_synopsis.rst
include/varnishstat_synopsis.rst \
include/varnishstat_bindings.rst
include/vsl-tags.rst: $(top_builddir)/lib/libvarnishapi/vsl2rst
$(top_builddir)/lib/libvarnishapi/vsl2rst > ${@}_
......
......@@ -71,54 +71,7 @@ Avg_1000
Key bindings
------------
The following keys control the interactive display:
<UP> or <k>
Navigate the counter list one line up.
<DOWN> or <j>
Navigate the counter list one line down.
<PAGEUP> or <b> or <CTRL-b>
Navigate the counter list one page up.
<PAGEDOWN> or <SPACE> or <CTRL-f>
Navigate the counter list one page down.
<HOME> or <g>
Navigate the counter list to the top.
<END> or <G>
Navigate the counter list to the bottom.
<d>
Toggle between showing and hiding unseen counters. Unseen
counters are those that has been zero for the entire runtime
of varnishstat. Defaults to hide unseen counters.
<e>
Toggle scaling of values.
<v>
Increase verbosity. Defaults to only showing informational
counters.
<V>
Decrease verbosity. Defaults to only showing informational
counters.
<q>
Quit.
<CTRL+T>
Sample now.
<+>
Increase refresh interval.
<->
Decrease refresh interval.
.. include:: ../include/varnishstat_bindings.rst
OUTPUTS
=======
......
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