From bdfa71baed65e750618deed30dc28160c5390aea Mon Sep 17 00:00:00 2001 From: djcb Date: Sat, 20 Oct 2012 16:53:54 +0300 Subject: [PATCH] * mu stats: don't need the --list option, it's the default --- man/mu-stats.1 | 10 +++++----- mu/mu-cmd-guile.c | 12 +++--------- mu/mu-config.c | 2 -- mu/mu-config.h | 2 -- mu/mu-help-strings.txt | 8 ++++---- 5 files changed, 12 insertions(+), 22 deletions(-) diff --git a/man/mu-stats.1 b/man/mu-stats.1 index b8a63c08..eb3f4755 100644 --- a/man/mu-stats.1 +++ b/man/mu-stats.1 @@ -6,7 +6,7 @@ mu stats\- run statistic on the mu database .SH SYNOPSIS -.B mu stats [options] --stat=|--list [] +.B mu stats [options] [--stat=] [] .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, 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 .TP -\fB\-\-list\fR -list the available statistics - \fB\-\-stat=\fR\fI\fR -run the given statistic; \fB--list\fR shows the available statistics +show the results for the given statistic \fB\-\-textonly\fR show the statistics in text-only format, even if the environment is diff --git a/mu/mu-cmd-guile.c b/mu/mu-cmd-guile.c index 352d443f..3421aaeb 100644 --- a/mu/mu-cmd-guile.c +++ b/mu/mu-cmd-guile.c @@ -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=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= 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); diff --git a/mu/mu-config.c b/mu/mu-config.c index e9353274..a3aa687b 100644 --- a/mu/mu-config.c +++ b/mu/mu-config.c @@ -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')", ""}, - {"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} diff --git a/mu/mu-config.h b/mu/mu-config.h index 56bfc49d..725ca422 100644 --- a/mu/mu-config.h +++ b/mu/mu-config.h @@ -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; diff --git a/mu/mu-help-strings.txt b/mu/mu-help-strings.txt index e4fb8489..4d97a494 100644 --- a/mu/mu-help-strings.txt +++ b/mu/mu-help-strings.txt @@ -98,11 +98,11 @@ mu4e e-mail client. #BEGIN MU_CONFIG_CMD_STATS #STRING -mu stats [options] --list|--stats= [] +mu stats [options] [--stat=] [] #STRING -Run some statistics on the mu database. Option '--stats=' selects the statistic to -show, optionally limited to the messages matching . -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 . Without '--stat', +lists the available statistics. #END