X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-dump.c;h=d8186fbc7c297495b77a39c1314f973af151a206;hp=a73587562fb9ce929e78807ec46fc8a97e5df087;hb=c158201ee217740cb1b64858df8c7d39cf7793d0;hpb=7ced2e32d1612aa5eb154b31705236f2483f364e diff --git a/notmuch-dump.c b/notmuch-dump.c index a7358756..d8186fbc 100644 --- a/notmuch-dump.c +++ b/notmuch-dump.c @@ -36,16 +36,15 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[]) if (config == NULL) return 1; - notmuch = notmuch_database_open (notmuch_config_get_database_path (config), - NOTMUCH_DATABASE_MODE_READ_ONLY); - if (notmuch == NULL) + if (notmuch_database_open (notmuch_config_get_database_path (config), + NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much)) return 1; char *output_file_name = NULL; int opt_index; notmuch_opt_desc_t options[] = { - { NOTMUCH_OPT_POSITION, &output_file_name, 0, 0, 0 }, + { NOTMUCH_OPT_STRING, &output_file_name, "output", 'o', 0 }, { 0, 0, 0, 0, 0 } }; @@ -57,7 +56,6 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[]) } if (output_file_name) { - fprintf (stderr, "Warning: the output file argument of dump is deprecated.\n"); output = fopen (output_file_name, "w"); if (output == NULL) { fprintf (stderr, "Error opening %s for writing: %s\n", @@ -116,7 +114,7 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[]) fclose (output); notmuch_query_destroy (query); - notmuch_database_close (notmuch); + notmuch_database_destroy (notmuch); return 0; }