* mu: some improvement in script handling

This commit is contained in:
djcb 2013-07-23 22:23:27 +03:00
parent b7219aaf82
commit 885554757a
3 changed files with 9 additions and 3 deletions

View File

@ -429,6 +429,8 @@ enum _MuError {
MU_ERROR_INTERNAL = 3,
MU_ERROR_NO_MATCHES = 4,
MU_ERROR_SCRIPT_NOT_FOUND = 8,
/* general xapian related error */
MU_ERROR_XAPIAN = 11,

View File

@ -185,8 +185,8 @@ mu_cmd_script (MuConfig *opts, GError **err)
msi = mu_script_find_script_with_name (scripts, opts->script);
if (!msi) {
mu_util_g_set_error (err, MU_ERROR_IN_PARAMETERS,
"script not found");
mu_util_g_set_error (err, MU_ERROR_SCRIPT_NOT_FOUND,
"command or script not found");
goto leave;
}

View File

@ -64,12 +64,16 @@ handle_error (MuConfig *conf, MuError merr, GError **err)
"try 'mu index --rebuild'\n");
break;
case MU_ERROR_XAPIAN_IS_EMPTY:
g_printerr ("database is empty; try 'mu index'");
g_printerr ("database is empty; try 'mu index'\n");
break;
case MU_ERROR_IN_PARAMETERS:
if (conf && mu_config_cmd_is_valid(conf->cmd))
mu_config_show_help (conf->cmd);
break;
case MU_ERROR_SCRIPT_NOT_FOUND:
g_printerr ("see the mu manpage for commands, or "
"'mu script' for the scripts\n");
break;
default:
break; /* nothing to do */
}