* mu-cmd-find, mu-cmd-cfind: make 'no matches found' uniform

This commit is contained in:
Dirk-Jan C. Binnema
2011-05-24 21:43:44 +03:00
parent 93522893bf
commit b6291e1522
2 changed files with 10 additions and 7 deletions

View File

@ -174,15 +174,18 @@ run_cmd_cfind (const char* pattern, OutputFormat format)
} }
print_header (format); print_header (format);
rv = mu_contacts_foreach (contacts, (MuContactsForeachFunc)each_contact, rv = mu_contacts_foreach (contacts,
(MuContactsForeachFunc)each_contact,
GINT_TO_POINTER(format), pattern, &num); GINT_TO_POINTER(format), pattern, &num);
mu_contacts_destroy (contacts); mu_contacts_destroy (contacts);
if (rv) if (num == 0) {
return (num == 0) ? MU_EXITCODE_NO_MATCHES : MU_EXITCODE_OK; g_warning ("no matching contacts found");
else return MU_EXITCODE_NO_MATCHES;
return MU_EXITCODE_ERROR; }
return rv ? MU_EXITCODE_OK : MU_EXITCODE_ERROR;
} }

View File

@ -180,8 +180,8 @@ run_query (MuQuery *xapian, const gchar *query, MuConfig *opts,
rv = run_query_format (iter, opts, format, count); rv = run_query_format (iter, opts, format, count);
if (rv && count && *count == 0) if (rv && count && *count == 0)
g_warning ("no matches found"); g_warning ("no matching messages found");
mu_msg_iter_destroy (iter); mu_msg_iter_destroy (iter);