Commit 1dfd93b1 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Give error message on -f filter parse errors for VSC (and varnishstat)

parent 26647ab0
......@@ -296,6 +296,7 @@ main(int argc, char * const *argv)
default:
if (VSC_Arg(vd, c, optarg) > 0)
break;
fprintf(stderr, "%s\n", VSM_Error(vd));
usage();
}
}
......
......@@ -226,6 +226,9 @@ vsc_f_arg(struct VSM_data *vd, const char *opt)
if (q != NULL && q[1] == '\0') {
*q = '\0';
sf->flags |= VSC_SF_TY_WC;
} else if (q != NULL) {
i = -1;
break;
}
}
if (sf->ident != NULL) {
......@@ -233,6 +236,9 @@ vsc_f_arg(struct VSM_data *vd, const char *opt)
if (q != NULL && q[1] == '\0') {
*q = '\0';
sf->flags |= VSC_SF_ID_WC;
} else if (q != NULL) {
i = -1;
break;
}
}
if (sf->name != NULL) {
......@@ -240,11 +246,18 @@ vsc_f_arg(struct VSM_data *vd, const char *opt)
if (q != NULL && q[1] == '\0') {
*q = '\0';
sf->flags |= VSC_SF_NM_WC;
} else if (q != NULL) {
i = -1;
break;
}
}
}
if (i < 0)
i = vsm_diag(vd, "Wildcard error: %s", opt);
else
i = 1;
VAV_Free(av);
return (1);
return (i);
}
/*--------------------------------------------------------------------*/
......
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