+static int get_names_args(poptContext *pc)
+{
+ char *str, *strlist, *strctx;
+
+ opt_payload_field_names = 0;
+ strlist = (char *) poptGetOptArg(*pc);
+ if (!strlist) {
+ return -EINVAL;
+ }
+ str = strtok_r(strlist, ",", &strctx);
+ do {
+ if (!strcmp(str, "all"))
+ opt_all_field_names = 1;
+ else if (!strcmp(str, "scope"))
+ opt_scope_field_names = 1;
+ else if (!strcmp(str, "context") || !strcmp(str, "ctx"))
+ opt_context_field_names = 1;
+ else if (!strcmp(str, "header"))
+ opt_header_field_names = 1;
+ else if (!strcmp(str, "payload") || !strcmp(str, "args") || !strcmp(str, "arg"))
+ opt_payload_field_names = 1;
+ else if (!strcmp(str, "trace"))
+ opt_trace_name = 1;
+ else if (!strcmp(str, "trace:domain"))
+ opt_trace_domain = 1;
+ else if (!strcmp(str, "trace:procname"))
+ opt_trace_procname = 1;
+ else if (!strcmp(str, "trace:vpid"))
+ opt_trace_vpid = 1;
+ else if (!strcmp(str, "loglevel"))
+ opt_loglevel = 1;
+ else {
+ fprintf(stderr, "[error] unknown field name type %s\n", str);
+ return -EINVAL;
+ }
+ } while ((str = strtok_r(NULL, ",", &strctx)));
+ return 0;
+}
+