Move an error condition specific to the 'tag' command out of
parse_tag_command_line so that parse_tag_command_line can be used for
the forthcoming 'insert' command.
fprintf (stderr, "Error: 'notmuch tag' requires at least one tag to add or remove.\n");
return 1;
}
+
+ if (*query_string == '\0') {
+ fprintf (stderr, "Error: notmuch tag requires at least one search term.\n");
+ return 1;
+ }
}
if (notmuch_database_open (notmuch_config_get_database_path (config),
*query_str = query_string_from_args (ctx, argc - i, &argv[i]);
- if (*query_str == NULL || **query_str == '\0') {
- fprintf (stderr, "Error: notmuch tag requires at least one search term.\n");
- return TAG_PARSE_INVALID;
+ if (*query_str == NULL) {
+ fprintf (stderr, "Out of memory.\n");
+ return TAG_PARSE_OUT_OF_MEMORY;
}
return TAG_PARSE_SUCCESS;