- switch (output) {
- default:
- case OUTPUT_SUMMARY:
- case OUTPUT_THREADS:
- ret = do_search_threads (format, query, sort, output, offset, limit);
- break;
- case OUTPUT_MESSAGES:
- case OUTPUT_FILES:
- ret = do_search_messages (format, query, output, offset, limit, dupe);
- break;
- case OUTPUT_TAGS:
- ret = do_search_tags (notmuch, format, query);
- break;
+ if (opt.output == OUTPUT_SUMMARY ||
+ opt.output == OUTPUT_THREADS)
+ ret = do_search_threads (&opt);
+ else if (opt.output == OUTPUT_MESSAGES ||
+ opt.output == OUTPUT_FILES)
+ ret = do_search_messages (&opt);
+ else if (opt.output == OUTPUT_TAGS)
+ ret = do_search_tags (notmuch, &opt);
+ else {
+ fprintf (stderr, "Error: the combination of outputs is not supported.\n");
+ ret = 1;