--- frm/frm.c.orig 2004-06-02 09:30:51.000000000 +0200 +++ frm/frm.c 2005-07-28 22:16:40.157666184 +0200 @@ -45,7 +45,8 @@ #include #include -static char *show_field; +static char **show_fields = NULL; +static int show_fields_count = 0; static int show_to; static int show_from = 1; static int show_subject = 1; @@ -181,6 +182,9 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) { + int i, arglen, count; + char* lastfield; + switch (key) { case 'd': @@ -188,7 +192,34 @@ break; case 'f': - show_field = arg; + if (strlen (arg) == 0) + break; + + /* at first count new fields */ + count = 1; + arglen = strlen (arg); + for (i = 0; i < arglen; i++) + { + if ((arg[i] == ',') || (arg[i] == ';') || (arg[i] == ' ')) + count++; + } + + show_fields = (char**)realloc (show_fields, (show_fields_count+count)*(sizeof (char*))); + + lastfield = arg; + for (i = 0; i < arglen; i++) + { + if ((arg[i] == ',') || (arg[i] == ';') || (arg[i] == ' ')) + { + /* terminate field */ + arg[i] = '\0'; + show_fields[show_fields_count++] = lastfield; + lastfield = &(arg[i+1]); + } + } + + show_fields[show_fields_count++] = lastfield; + show_from = 0; show_subject = 0; align = 0; @@ -222,7 +253,7 @@ break; case 's': - select_attribute = decode_attr (optarg); + select_attribute = decode_attr (arg); break; case 't': @@ -377,13 +408,20 @@ if (show_number) printf ("%4lu: ", (u_long) counter.index); - if (show_field) + if (show_fields != NULL) { char hfield[256]; - status = header_get_value_unfold (hdr, show_field, hfield, - sizeof (hfield), NULL); - if (status == 0) - printf ("%s", hfield); + int i; + + for (i = 0; i < show_fields_count; i++) + { + status = header_get_value_unfold (hdr, show_fields[i], hfield, + sizeof (hfield), NULL); + if (i > 0) + printf (" "); + if (status == 0) + printf ("%s", hfield); + } } if (show_to) --- doc/texinfo/programs.texi.org 2004-12-06 13:33:05.000000000 +0100 +++ doc/texinfo/programs.texi 2005-07-28 21:34:02.909253944 +0200 @@ -494,8 +494,11 @@ @table @option @item -f @var{string} @itemx --field @var{string} -Display the header named by @var{string} instead of @code{From} address@hidden pair. +Display the headers specified by @var{string} instead of @code{From} address@hidden pair. Multiple header may be given, separated by comma, +semicolon or spaces. Alternatively, the option may be given multiple +times. Headers are output in the same order they are specified, +separated by spaces. @item -l @itemx --to Include the contents of @code{To} header to the output. The output field