X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-show.c;h=c2ec122c75ed2cf482f0ae1e00be664fd160fca0;hp=5ae5d7de1ab804d82ff09e8a6fef3cdbe46d58b8;hb=4ef2106792439f5ade157b3ba3b8f7fa86fcb3ed;hpb=e76f6517de020783d828be59f461f1d4f465c4b4 diff --git a/notmuch-show.c b/notmuch-show.c index 5ae5d7de..c2ec122c 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -1056,9 +1056,8 @@ enum { }; int -notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[])) +notmuch_show_command (notmuch_config_t *config, int argc, char *argv[]) { - notmuch_config_t *config; notmuch_database_t *notmuch; notmuch_query_t *query; char *query_string; @@ -1176,11 +1175,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[])) else params.entire_thread = FALSE; - config = notmuch_config_open (ctx, NULL, FALSE); - if (config == NULL) - return 1; - - query_string = query_string_from_args (ctx, argc-opt_index, argv+opt_index); + query_string = query_string_from_args (config, argc-opt_index, argv+opt_index); if (query_string == NULL) { fprintf (stderr, "Out of memory\n"); return 1; @@ -1202,11 +1197,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[])) } /* Create structure printer. */ - sprinter = format->new_sprinter(ctx, stdout); + sprinter = format->new_sprinter(config, stdout); /* If a single message is requested we do not use search_excludes. */ if (params.part >= 0) - ret = do_show_single (ctx, query, format, sprinter, ¶ms); + ret = do_show_single (config, query, format, sprinter, ¶ms); else { /* We always apply set the exclude flag. The * exclude=true|false option controls whether or not we return @@ -1225,7 +1220,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[])) params.omit_excluded = FALSE; } - ret = do_show (ctx, query, format, sprinter, ¶ms); + ret = do_show (config, query, format, sprinter, ¶ms); } notmuch_crypto_cleanup (¶ms.crypto);