This makes part retrieval a little more intuitive, since generally one
will always want to retrieve parts in raw form.
const notmuch_show_format_t *format = &format_text;
notmuch_show_params_t params;
int mbox = 0;
const notmuch_show_format_t *format = &format_text;
notmuch_show_params_t params;
int mbox = 0;
+ int format_specified = 0;
int i;
params.entire_thread = 0;
int i;
params.entire_thread = 0;
fprintf (stderr, "Invalid value for --format: %s\n", opt);
return 1;
}
fprintf (stderr, "Invalid value for --format: %s\n", opt);
return 1;
}
} else if (STRNCMP_LITERAL (argv[i], "--part=") == 0) {
params.part = atoi(argv[i] + sizeof ("--part=") - 1);
} else if (STRNCMP_LITERAL (argv[i], "--entire-thread") == 0) {
} else if (STRNCMP_LITERAL (argv[i], "--part=") == 0) {
params.part = atoi(argv[i] + sizeof ("--part=") - 1);
} else if (STRNCMP_LITERAL (argv[i], "--entire-thread") == 0) {
+ /* if part was requested and format was not specified, use format=raw */
+ if (params.part >= 0 && !format_specified)
+ format = &format_raw;
+
/* If --format=raw specified without specifying part, we can only
* output single message, so set part=0 */
if (params.raw && params.part < 0)
/* If --format=raw specified without specifying part, we can only
* output single message, so set part=0 */
if (params.raw && params.part < 0)