mirror of https://github.com/djcb/mu.git
* mu: some improvement in script handling
This commit is contained in:
parent
b7219aaf82
commit
885554757a
|
@ -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,
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
6
mu/mu.cc
6
mu/mu.cc
|
@ -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 */
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue