if (notmuch_config_get_search_exclude_tags (config, &tmp) == NULL) {
if (is_new) {
- /* We do not set default search_exclude_tags for 0.12 */
+ const char *tags[] = { "deleted", "spam" };
+ notmuch_config_set_search_exclude_tags (config, tags, 2);
} else {
notmuch_config_set_search_exclude_tags (config, NULL, 0);
}
for (i = 0; i < length; i++)
printf ("%s\n", value[i]);
- free (value);
+ g_strfreev (value);
}
notmuch_config_close (config);
{
argc--; argv++; /* skip subcommand argument */
- if (argc < 2) {
- fprintf (stderr, "Error: notmuch config requires at least two arguments.\n");
+ if (argc < 1) {
+ fprintf (stderr, "Error: notmuch config requires at least one argument.\n");
return 1;
}
- if (strcmp (argv[0], "get") == 0)
+ if (strcmp (argv[0], "get") == 0) {
+ if (argc != 2) {
+ fprintf (stderr, "Error: notmuch config get requires exactly "
+ "one argument.\n");
+ return 1;
+ }
return notmuch_config_command_get (ctx, argv[1]);
- else if (strcmp (argv[0], "set") == 0)
+ } else if (strcmp (argv[0], "set") == 0) {
+ if (argc < 2) {
+ fprintf (stderr, "Error: notmuch config set requires at least "
+ "one argument.\n");
+ return 1;
+ }
return notmuch_config_command_set (ctx, argv[1], argc - 2, argv + 2);
+ }
fprintf (stderr, "Unrecognized argument for notmuch config: %s\n",
argv[0]);