Fix: -n "field names" option should allow "none"
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 18 Apr 2012 21:11:41 +0000 (17:11 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 18 Apr 2012 21:11:41 +0000 (17:11 -0400)
- Update manpage, help, and cmd line arg parsing.
- Clarify that the default behavior is "payload,context", implying
  that specifying -n ... overrides the default behavior.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
converter/babeltrace.c
doc/babeltrace.1

index cb05891d682aa2a6438276a44d87e6dfb8961137..11c10cf8aa488657ac9fae1fcd0ac9e98d01525e 100644 (file)
@@ -123,8 +123,8 @@ static void usage(FILE *fp)
        fprintf(fp, "      --no-delta                 Do not print time delta between consecutive events\n");
        fprintf(fp, "  -n, --names name1<,name2,...>  Print field names:\n");
        fprintf(fp, "                                     (payload OR args OR arg)\n");
        fprintf(fp, "      --no-delta                 Do not print time delta between consecutive events\n");
        fprintf(fp, "  -n, --names name1<,name2,...>  Print field names:\n");
        fprintf(fp, "                                     (payload OR args OR arg)\n");
-       fprintf(fp, "                                     all, scope, header, (context OR ctx)\n");
-       fprintf(fp, "                                        (payload active by default)\n");
+       fprintf(fp, "                                     none, all, scope, header, (context OR ctx)\n");
+       fprintf(fp, "                                        (default: payload,context)\n");
        fprintf(fp, "  -f, --fields name1<,name2,...> Print additional fields:\n");
        fprintf(fp, "                                     all, trace, trace:domain, trace:procname,\n");
        fprintf(fp, "                                     trace:vpid, loglevel.\n");
        fprintf(fp, "  -f, --fields name1<,name2,...> Print additional fields:\n");
        fprintf(fp, "                                     all, trace, trace:domain, trace:procname,\n");
        fprintf(fp, "                                     trace:vpid, loglevel.\n");
@@ -145,6 +145,7 @@ static int get_names_args(poptContext *pc)
        char *str, *strlist, *strctx;
 
        opt_payload_field_names = 0;
        char *str, *strlist, *strctx;
 
        opt_payload_field_names = 0;
+       opt_context_field_names = 0;
        strlist = (char *) poptGetOptArg(*pc);
        if (!strlist) {
                return -EINVAL;
        strlist = (char *) poptGetOptArg(*pc);
        if (!strlist) {
                return -EINVAL;
@@ -161,7 +162,13 @@ static int get_names_args(poptContext *pc)
                        opt_header_field_names = 1;
                else if (!strcmp(str, "payload") || !strcmp(str, "args") || !strcmp(str, "arg"))
                        opt_payload_field_names = 1;
                        opt_header_field_names = 1;
                else if (!strcmp(str, "payload") || !strcmp(str, "args") || !strcmp(str, "arg"))
                        opt_payload_field_names = 1;
-               else {
+               else if (!strcmp(str, "none")) {
+                       opt_all_field_names = 0;
+                       opt_scope_field_names = 0;
+                       opt_context_field_names = 0;
+                       opt_header_field_names = 0;
+                       opt_payload_field_names = 0;
+               } else {
                        fprintf(stderr, "[error] unknown field name type %s\n", str);
                        return -EINVAL;
                }
                        fprintf(stderr, "[error] unknown field name type %s\n", str);
                        return -EINVAL;
                }
index 3f0160cafa400f068a7cfa8f163d0c176a6eb7bf..db07cafa0477b8cbd2fe53c5b9533f4e013331b3 100644 (file)
@@ -50,8 +50,8 @@ Debug mode (or set BABELTRACE_DEBUG environment variable)
 Do not print time delta between consecutive events
 .TP
 .BR "-n, --names name1<,name2,...>"
 Do not print time delta between consecutive events
 .TP
 .BR "-n, --names name1<,name2,...>"
-Print field names: (payload OR args OR arg), all, scope, header,
-(context OR ctx), (payload active by default).
+Print field names: (payload OR args OR arg), none, all, scope, header,
+(context OR ctx), (default: payload,context).
 .TP
 .BR "-f, --fields name1<,name2,...>"
 Print additional fields: all, trace, trace:domain, trace:procname,
 .TP
 .BR "-f, --fields name1<,name2,...>"
 Print additional fields: all, trace, trace:domain, trace:procname,
This page took 0.034929 seconds and 4 git commands to generate.