Commit 6b2a3a39 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Fix rst option generation

parent 673a8555
......@@ -60,7 +60,7 @@
)
#define VSL_OPT_g \
VOPT("g:", "[-g {session|request|vxid|raw}]", "Grouping mode", \
VOPT("g:", "[-g <session|request|vxid|raw>]", "Grouping mode", \
"The grouping of the log records. The default is to group" \
" by request." \
)
......@@ -74,7 +74,7 @@
)
#define VSL_OPT_I \
VOPT("I:", "[-I [tag:]regex]", "Include by regex", \
VOPT("I:", "[-I <[tag:]regex>]", "Include by regex", \
"Include by regex matching. Output only records matching" \
" tag and regular expression. Applies to any tag if tag" \
" is * or empty.\n" \
......@@ -115,7 +115,7 @@
)
#define VSL_OPT_X \
VOPT("X:", "[-X [tag:]regex]", "Exclude by regex", \
VOPT("X:", "[-X <[tag:]regex>]", "Exclude by regex", \
"Exclude by regex matching. Do not output records matching" \
" tag and regular expression. Applies to any tag if tag" \
" is * or empty." \
......
......@@ -30,17 +30,29 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "vapi/voptget.h"
static void
print_nobrackets(const char *s)
{
for (; *s; s++) {
if (strchr("[]", *s))
continue;
printf("%c", *s);
const char *e;
/* Remove whitespace */
while (isspace(*s))
s++;
e = s + strlen(s);
while (e > s && isspace(e[-1]))
e--;
/* Remove outer layer brackets if present */
if (e > s && *s == '[' && e[-1] == ']') {
s++;
e--;
}
printf("%.*s", (int)(e - s), s);
}
static void
......
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