message = notmuch_messages_get (messages);
- if (dump_tags_message (notmuch, message, output_format, output,
+ if ((include & DUMP_INCLUDE_TAGS) &&
+ dump_tags_message (notmuch, message, output_format, output,
&buffer, &buffer_size))
return EXIT_FAILURE;