+
+int
+notmuch_config_command (notmuch_config_t *config, int argc, char *argv[])
+{
+ int ret;
+ int opt_index;
+
+ opt_index = notmuch_minimal_options ("config", argc, argv);
+ if (opt_index < 0)
+ return EXIT_FAILURE;
+
+ if (notmuch_requested_db_uuid)
+ fprintf (stderr, "Warning: ignoring --uuid=%s\n",
+ notmuch_requested_db_uuid);
+
+ /* skip at least subcommand argument */
+ argc-= opt_index;
+ argv+= opt_index;
+
+ if (argc < 1) {
+ fprintf (stderr, "Error: notmuch config requires at least one argument.\n");
+ return EXIT_FAILURE;
+ }
+
+ if (strcmp (argv[0], "get") == 0) {
+ if (argc != 2) {
+ fprintf (stderr, "Error: notmuch config get requires exactly "
+ "one argument.\n");
+ return EXIT_FAILURE;
+ }
+ ret = notmuch_config_command_get (config, argv[1]);
+ } else if (strcmp (argv[0], "set") == 0) {
+ if (argc < 2) {
+ fprintf (stderr, "Error: notmuch config set requires at least "
+ "one argument.\n");
+ return EXIT_FAILURE;
+ }
+ ret = notmuch_config_command_set (config, argv[1], argc - 2, argv + 2);
+ } else if (strcmp (argv[0], "list") == 0) {
+ ret = notmuch_config_command_list (config);
+ } else {
+ fprintf (stderr, "Unrecognized argument for notmuch config: %s\n",
+ argv[0]);
+ return EXIT_FAILURE;
+ }
+
+ return ret ? EXIT_FAILURE : EXIT_SUCCESS;
+
+}
+
+notmuch_bool_t
+notmuch_config_get_maildir_synchronize_flags (notmuch_config_t *config)
+{
+ return config->maildir_synchronize_flags;
+}
+
+void
+notmuch_config_set_maildir_synchronize_flags (notmuch_config_t *config,
+ notmuch_bool_t synchronize_flags)
+{
+ g_key_file_set_boolean (config->key_file,
+ "maildir", "synchronize_flags", synchronize_flags);
+ config->maildir_synchronize_flags = synchronize_flags;
+}