mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-25 10:54:52 +01:00
throw error if mbox format specified with --part
These formats are incompatible, since mbox format requires full messages.
This commit is contained in:
parent
150db11214
commit
bdc260ae28
1 changed files with 7 additions and 0 deletions
|
@ -709,6 +709,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
|
|||
char *opt;
|
||||
const notmuch_show_format_t *format = &format_text;
|
||||
notmuch_show_params_t params;
|
||||
int mbox = 0;
|
||||
int i;
|
||||
|
||||
params.entire_thread = 0;
|
||||
|
@ -729,6 +730,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
|
|||
params.entire_thread = 1;
|
||||
} else if (strcmp (opt, "mbox") == 0) {
|
||||
format = &format_mbox;
|
||||
mbox = 1;
|
||||
} else if (strcmp (opt, "raw") == 0) {
|
||||
format = &format_raw;
|
||||
params.raw = 1;
|
||||
|
@ -759,6 +761,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (mbox && params.part > 0) {
|
||||
fprintf (stderr, "Error: specifying parts is incompatible with mbox output format.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (*query_string == '\0') {
|
||||
fprintf (stderr, "Error: notmuch show requires at least one search term.\n");
|
||||
return 1;
|
||||
|
|
Loading…
Reference in a new issue