mirror of https://github.com/djcb/mu.git
* mu: improve mu script help
This commit is contained in:
parent
4e6f104085
commit
d1c36c06d7
|
@ -1,3 +1,4 @@
|
|||
|
||||
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
||||
|
||||
/*
|
||||
|
@ -76,7 +77,9 @@ print_scripts (GSList *scripts, gboolean verbose, const char *rxstr,
|
|||
g_print ("\n");
|
||||
first = FALSE;
|
||||
|
||||
g_print ("%s%s%s", name,
|
||||
g_print ("%s%s%s%s",
|
||||
verbose ? "" : " * ",
|
||||
name,
|
||||
oneline ? ": " : "",
|
||||
oneline ? oneline :"");
|
||||
|
||||
|
|
|
@ -601,13 +601,18 @@ cmd_help (void)
|
|||
{
|
||||
MuConfigCmd cmd;
|
||||
|
||||
cmd = cmd_from_string (MU_CONFIG.params[1]);
|
||||
if (!MU_CONFIG.params)
|
||||
cmd = MU_CONFIG_CMD_UNKNOWN;
|
||||
else
|
||||
cmd = cmd_from_string (MU_CONFIG.params[1]);
|
||||
|
||||
if (cmd == MU_CONFIG_CMD_UNKNOWN) {
|
||||
mu_config_show_help (MU_CONFIG_CMD_HELP);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
mu_config_show_help (cmd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -640,6 +645,8 @@ parse_params (int *argcp, char ***argvp)
|
|||
case MU_CONFIG_CMD_HELP:
|
||||
/* 'help' is special; sucks in the options of the
|
||||
* command after it */
|
||||
g_option_context_set_main_group(context,
|
||||
config_options_group_mu());
|
||||
rv = g_option_context_parse (context, argcp, argvp, &err) &&
|
||||
cmd_help ();
|
||||
break;
|
||||
|
|
|
@ -21,9 +21,8 @@
|
|||
#STRING
|
||||
mu add <file> [<files>]
|
||||
#STRING
|
||||
mu add is the command to add specific measage files to the
|
||||
database. Each of the files must be specified with an
|
||||
absolute path
|
||||
mu add is the command to add specific measage files to the database. Each of the
|
||||
files must be specified with an absolute path.
|
||||
#END
|
||||
|
||||
#BEGIN MU_CONFIG_CMD_CFIND
|
||||
|
@ -48,8 +47,19 @@ mu find [options] <search expression>
|
|||
#STRING
|
||||
mu find is the mu command for searching e-mail message that were
|
||||
stored earlier using mu index(1).
|
||||
#END
|
||||
|
||||
Some examples:
|
||||
# get all messages with 'bananas' in body, subject or recipient fields:
|
||||
$ mu find bananas
|
||||
|
||||
# get all messages regarding bananas from John with an attachment:
|
||||
$ mu find from:john flag:attach bananas
|
||||
|
||||
# get all messages with subject wombat in June 2009
|
||||
$ mu find subject:wombat date:20090601..20090630
|
||||
|
||||
See the `mu-find' and `mu-easy' man-pages for more information.
|
||||
#END
|
||||
|
||||
#BEGIN MU_CONFIG_CMD_HELP
|
||||
#STRING
|
||||
|
@ -106,6 +116,17 @@ With -v, give longer descriptions of each script.
|
|||
|
||||
With --script=<script>, run the script whose name is <script>; pass
|
||||
any arguments to the script after the '--' double-dash.
|
||||
|
||||
Some examples:
|
||||
List all available scripts (one-line descriptions):
|
||||
$ mu script
|
||||
|
||||
List all available scripts matching 'month' (long descriptions):
|
||||
$ mu script -v month
|
||||
|
||||
Run the 'msgs-per-month' script, and pass it the '--textonly' parameter:
|
||||
$ mu script --script=msgs-per-month -- --textonly
|
||||
(as mentioned, parameters to the script follow the '--')
|
||||
#END
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue