* mu stats: don't need the --list option, it's the default

This commit is contained in:
djcb 2012-10-20 16:53:54 +03:00
parent 88e76d50df
commit bdfa71baed
5 changed files with 12 additions and 22 deletions

View File

@ -6,7 +6,7 @@ mu stats\- run statistic on the mu database
.SH SYNOPSIS .SH SYNOPSIS
.B mu stats [options] --stat=<statistic>|--list [<query>] .B mu stats [options] [--stat=<statistic>] [<query>]
.SH DESCRIPTION .SH DESCRIPTION
@ -15,14 +15,14 @@ database. The statistics are implement in the Guile programming language, and
thus only work if your \fBmu\fR is built with support for Guile. In addition, thus only work if your \fBmu\fR is built with support for Guile. In addition,
you need to have \fBgnuplot\fR installed. you need to have \fBgnuplot\fR installed.
\fBmu stats\fR supports a number of different statistics; running \fBmu
stats\fR without any options, lists the available statistics.
.SH OPTIONS .SH OPTIONS
.TP .TP
\fB\-\-list\fR
list the available statistics
\fB\-\-stat=\fR\fI<statistic>\fR \fB\-\-stat=\fR\fI<statistic>\fR
run the given statistic; \fB--list\fR shows the available statistics show the results for the given statistic
\fB\-\-textonly\fR \fB\-\-textonly\fR
show the statistics in text-only format, even if the environment is show the statistics in text-only format, even if the environment is

View File

@ -214,7 +214,8 @@ list_stats (GError **err)
g_print ("No statistics available\n"); g_print ("No statistics available\n");
else { else {
GSList *cur; GSList *cur;
g_print ("Available statistics:\n"); g_print ("Available statistics "
"(use with --stat=<stastistic):\n");
for (cur = scripts; cur; cur = g_slist_next (cur)) for (cur = scripts; cur; cur = g_slist_next (cur))
g_print ("\t%s\n", ((NamePath*)cur->data)->name); g_print ("\t%s\n", ((NamePath*)cur->data)->name);
} }
@ -235,13 +236,6 @@ check_params (MuConfig *opts, GError **err)
return FALSE; return FALSE;
} }
if (!opts->list && !opts->stat) {
mu_util_g_set_error
(err,MU_ERROR_IN_PARAMETERS,
"--stat=<statistic> or --list is required");
return FALSE;
}
return TRUE; return TRUE;
} }
@ -256,7 +250,7 @@ mu_cmd_stats (MuConfig *opts, GError **err)
if (!check_params (opts, err)) if (!check_params (opts, err))
return MU_ERROR; return MU_ERROR;
if (opts->list) if (!opts->stat)
return list_stats (err); return list_stats (err);
run_guile_script (opts, err); run_guile_script (opts, err);

View File

@ -298,8 +298,6 @@ config_options_group_stats (void)
GOptionEntry entries[] = { GOptionEntry entries[] = {
{"stat", 0, 0, G_OPTION_ARG_STRING, &MU_CONFIG.stat, {"stat", 0, 0, G_OPTION_ARG_STRING, &MU_CONFIG.stat,
"statistic to show (see `mu help stats')", "<statistic>"}, "statistic to show (see `mu help stats')", "<statistic>"},
{"list", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.list,
"list available statistics", NULL},
{"textonly", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.textonly, {"textonly", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.textonly,
"use text-only output", NULL}, "use text-only output", NULL},
{NULL, 0, 0, 0, NULL, NULL, NULL} {NULL, 0, 0, 0, NULL, NULL, NULL}

View File

@ -179,8 +179,6 @@ struct _MuConfig {
/* options for mu-stats */ /* options for mu-stats */
gboolean textonly; /* no non-textual graphs */ gboolean textonly; /* no non-textual graphs */
gchar *stat; /* statistic to show */ gchar *stat; /* statistic to show */
gboolean list; /* list available stats */
}; };
typedef struct _MuConfig MuConfig; typedef struct _MuConfig MuConfig;

View File

@ -98,11 +98,11 @@ mu4e e-mail client.
#BEGIN MU_CONFIG_CMD_STATS #BEGIN MU_CONFIG_CMD_STATS
#STRING #STRING
mu stats [options] --list|--stats=<statistic> [<query>] mu stats [options] [--stat=<statistic>] [<query>]
#STRING #STRING
Run some statistics on the mu database. Option '--stats=' selects the statistic to Run some statistics on the mu database. Option '--stat=' selects the statistic to
show, optionally limited to the messages matching <query>. show, optionally limited to the messages matching <query>. Without '--stat',
Option '--list' lists the available statistics lists the available statistics.
#END #END