* make sure line35, cc10 pass

This commit is contained in:
djcb 2012-09-09 14:21:15 +03:00
parent 3132b8dd42
commit cf37e29101
2 changed files with 15 additions and 18 deletions

View File

@ -515,13 +515,6 @@ show_usage (void)
"more information\n");
}
static void
show_version (void)
{
g_print ("mu (mail indexer/searcher) version " VERSION "\n"
"Copyright (C) 2008-2011 Dirk-Jan C. Binnema (GPLv3+)\n");
}
typedef MuError (*store_func) (MuStore *, MuConfig *, GError **err);
MuError
@ -569,11 +562,6 @@ mu_cmd_execute (MuConfig *opts, GError **err)
MuError merr;
g_return_val_if_fail (opts, MU_ERROR_INTERNAL);
if (opts->version) {
show_version ();
return MU_OK;
}
if (!check_params(opts, err))
return MU_G_ERROR_CODE(err);

View File

@ -32,6 +32,14 @@
#include "mu-runtime.h"
static void
show_version (void)
{
g_print ("mu (mail indexer/searcher) version " VERSION "\n"
"Copyright (C) 2008-2012 Dirk-Jan C. Binnema (GPLv3+)\n");
}
static void
handle_error (MuConfig *conf, GError *err)
{
@ -47,13 +55,11 @@ handle_error (MuConfig *conf, GError *err)
switch (err->code) {
case MU_ERROR_XAPIAN_CANNOT_GET_WRITELOCK:
advise = "maybe mu is already running?";
break;
advise = "maybe mu is already running?"; break;
case MU_ERROR_XAPIAN_CORRUPTION:
case MU_ERROR_XAPIAN_NOT_UP_TO_DATE:
advise = "please try 'mu index --rebuild'";
break;
advise = "please try 'mu index --rebuild'"; break;
case MU_ERROR_XAPIAN_IS_EMPTY:
advise = "please try 'mu index'";
break;
@ -62,8 +68,7 @@ handle_error (MuConfig *conf, GError *err)
dynadvise = g_strdup_printf ("see 'mu help %s'",
conf->cmdstr);
break;
default:
break; /* nothing to do */
default:break; /* nothing to do */
}
g_warning ("%s", err->message);
@ -89,6 +94,10 @@ main (int argc, char *argv[])
conf = mu_config_init (&argc, &argv);
if (!conf)
return 1;
else if (conf->version) {
show_version ();
return 0;
}
if (!mu_runtime_init (conf->muhome, PACKAGE_NAME)) {
mu_config_uninit (conf);