+ config = notmuch_config_open (ctx, NULL, NULL);
+ if (config == NULL)
+ return 1;
+
+ notmuch = notmuch_database_open (notmuch_config_get_database_path (config),
+ NOTMUCH_DATABASE_MODE_READ_WRITE);
+ if (notmuch == NULL)
+ return 1;
+
+ synchronize_flags = notmuch_config_get_maildir_synchronize_flags (config);
+
+ notmuch_opt_desc_t options[] = {
+ { NOTMUCH_OPT_POSITION, &input_file_name, 0, 0, 0 },
+ { NOTMUCH_OPT_BOOLEAN, &accumulate, "accumulate", 'a', 0 },
+ { 0, 0, 0, 0, 0 }
+ };
+
+ opt_index = parse_arguments (argc, argv, options, 1);
+
+ if (opt_index < 0) {
+ /* diagnostics already printed */
+ return 1;
+ }
+
+ if (input_file_name) {
+ input = fopen (input_file_name, "r");