]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-reply.c
cli: add .present field to opt desc to check if the arg was present
[notmuch] / notmuch-reply.c
index 4c1dd56024698041f1c97bca50347ffca8cace2e..e7ead79d755d2a7d4439c191094c46aac7099d13 100644 (file)
@@ -286,7 +286,7 @@ static InternetAddressList *get_sender(GMimeMessage *message)
        if (! reply_to_header_is_redundant (message, reply_to_list))
            return reply_to_list;
 
-       g_object_unref (G_OBJECT (reply_to_list));
+       g_mime_2_6_unref (G_OBJECT (reply_to_list));
     }
 
     return g_mime_message_get_from (message);
@@ -667,7 +667,7 @@ static int do_reply(notmuch_config_t *config,
 
            /* Start the original */
            sp->map_key (sp, "original");
-           format_part_sprinter (config, sp, node, TRUE, TRUE, FALSE);
+           format_part_sprinter (config, sp, node, TRUE, FALSE);
 
            /* End */
            sp->end (sp);
@@ -705,20 +705,20 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[])
     int reply_all = TRUE;
 
     notmuch_opt_desc_t options[] = {
-       { NOTMUCH_OPT_KEYWORD, &format, "format", 'f',
+       { .opt_keyword = &format, .name = "format", .keywords =
          (notmuch_keyword_t []){ { "default", FORMAT_DEFAULT },
                                  { "json", FORMAT_JSON },
                                  { "sexp", FORMAT_SEXP },
                                  { "headers-only", FORMAT_HEADERS_ONLY },
                                  { 0, 0 } } },
-       { NOTMUCH_OPT_INT, &notmuch_format_version, "format-version", 0, 0 },
-       { NOTMUCH_OPT_KEYWORD, &reply_all, "reply-to", 'r',
+       { .opt_int = &notmuch_format_version, .name = "format-version" },
+       { .opt_keyword = &reply_all, .name = "reply-to", .keywords =
          (notmuch_keyword_t []){ { "all", TRUE },
                                  { "sender", FALSE },
                                  { 0, 0 } } },
-       { NOTMUCH_OPT_BOOLEAN, &params.crypto.decrypt, "decrypt", 'd', 0 },
-       { NOTMUCH_OPT_INHERIT, (void *) &notmuch_shared_options, NULL, 0, 0 },
-       { 0, 0, 0, 0, 0 }
+       { .opt_bool = &params.crypto.decrypt, .name = "decrypt" },
+       { .opt_inherit = notmuch_shared_options },
+       { }
     };
 
     opt_index = parse_arguments (argc, argv, options, 1);
@@ -740,7 +740,9 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[])
        return EXIT_FAILURE;
     }
 
+#if (GMIME_MAJOR_VERSION < 3)
     params.crypto.gpgpath = notmuch_config_get_crypto_gpg_path (config);
+#endif
 
     if (notmuch_database_open (notmuch_config_get_database_path (config),
                               NOTMUCH_DATABASE_MODE_READ_ONLY, &notmuch))