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

Fix rst option generation

parent 673a8555
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
) )
#define VSL_OPT_g \ #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" \ "The grouping of the log records. The default is to group" \
" by request." \ " by request." \
) )
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
) )
#define VSL_OPT_I \ #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" \ "Include by regex matching. Output only records matching" \
" tag and regular expression. Applies to any tag if tag" \ " tag and regular expression. Applies to any tag if tag" \
" is * or empty.\n" \ " is * or empty.\n" \
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
) )
#define VSL_OPT_X \ #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" \ "Exclude by regex matching. Do not output records matching" \
" tag and regular expression. Applies to any tag if tag" \ " tag and regular expression. Applies to any tag if tag" \
" is * or empty." \ " is * or empty." \
......
...@@ -30,17 +30,29 @@ ...@@ -30,17 +30,29 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include "vapi/voptget.h" #include "vapi/voptget.h"
static void static void
print_nobrackets(const char *s) print_nobrackets(const char *s)
{ {
for (; *s; s++) { const char *e;
if (strchr("[]", *s))
continue; /* Remove whitespace */
printf("%c", *s); 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 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