* 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

@ -214,7 +214,8 @@ list_stats (GError **err)
g_print ("No statistics available\n");
else {
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))
g_print ("\t%s\n", ((NamePath*)cur->data)->name);
}
@ -235,13 +236,6 @@ check_params (MuConfig *opts, GError **err)
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;
}
@ -256,7 +250,7 @@ mu_cmd_stats (MuConfig *opts, GError **err)
if (!check_params (opts, err))
return MU_ERROR;
if (opts->list)
if (!opts->stat)
return list_stats (err);
run_guile_script (opts, err);

View File

@ -298,8 +298,6 @@ config_options_group_stats (void)
GOptionEntry entries[] = {
{"stat", 0, 0, G_OPTION_ARG_STRING, &MU_CONFIG.stat,
"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,
"use text-only output", NULL},
{NULL, 0, 0, 0, NULL, NULL, NULL}

View File

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

View File

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