X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch-config.c;h=f9eb97780c54673ca61bcae292e077c22b66745f;hb=86f01063d74cb45ed83df80c9406262ae533d178;hp=1f0112887d0eeebbc6f61c9ac9857f758a8e197b;hpb=ce1e720de64270a7cbb4bc3fba2c7fe081de3edc;p=notmuch diff --git a/notmuch-config.c b/notmuch-config.c index 1f011288..f9eb9778 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -47,7 +47,10 @@ static const char new_config_comment[] = "\t added to all messages incorporated by \"notmuch new\".\n" "\n" "\tignore A list (separated by ';') of file and directory names\n" - "\t that will not be searched for messages by \"notmuch new\".\n"; + "\t that will not be searched for messages by \"notmuch new\".\n" + "\n" + "\t NOTE: *Every* file/directory that goes by one of those names will\n" + "\t be ignored, independent of its depth/location in the mail store.\n"; static const char user_config_comment[] = " User configuration\n" @@ -748,7 +751,7 @@ notmuch_config_command_get (void *ctx, char *item) for (i = 0; i < length; i++) printf ("%s\n", value[i]); - free (value); + g_strfreev (value); } notmuch_config_close (config); @@ -801,15 +804,26 @@ notmuch_config_command (void *ctx, int argc, char *argv[]) { 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]);