diff options
author | Jameson Graef Rollins <jrollins@finestructure.net> | 2011-05-23 00:35:37 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2011-05-24 12:04:08 -0700 |
commit | bdc260ae28301da1d022ead53555fb9369ce04e7 (patch) | |
tree | eb361ae71413a81b03d9186057ec878ca948bf82 /notmuch-show.c | |
parent | 150db11214fead32af8b8a90920947d3a6570295 (diff) |
throw error if mbox format specified with --part
These formats are incompatible, since mbox format requires full
messages.
Diffstat (limited to 'notmuch-show.c')
-rw-r--r-- | notmuch-show.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/notmuch-show.c b/notmuch-show.c index e128be5..c57f7bd 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -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; |