- query = notmuch_query_create (notmuch, "");
- if (query == NULL) {
- fprintf (stderr, "Out of memory\n");
+ int output_format = DUMP_FORMAT_SUP;
+
+ notmuch_opt_desc_t options[] = {
+ { NOTMUCH_OPT_KEYWORD, &output_format, "format", 'f',
+ (notmuch_keyword_t []){ { "sup", DUMP_FORMAT_SUP },
+ { "batch-tag", DUMP_FORMAT_BATCH_TAG },
+ { 0, 0 } } },
+ { NOTMUCH_OPT_STRING, &output_file_name, "output", 'o', 0 },
+ { 0, 0, 0, 0, 0 }
+ };
+
+ opt_index = parse_arguments (argc, argv, options, 1);
+
+ if (opt_index < 0) {
+ /* diagnostics already printed */