* remove the --summary option (mu view, mu find), add the --after option (mu

find). see the documentation for details.
This commit is contained in:
djcb 2012-07-12 18:09:04 +03:00
parent d6ccf64ea8
commit 8f6d7b8388
4 changed files with 10 additions and 41 deletions

View File

@ -340,13 +340,9 @@ Note, if you specify a sortfield, by default, messages are sorted in reverse
(descending) order (e.g., from lowest to highest). This is usually a good (descending) order (e.g., from lowest to highest). This is usually a good
choice, but for dates it may be more useful to sort in the opposite direction. choice, but for dates it may be more useful to sort in the opposite direction.
.TP
\fB\-\-summary\fR
output a summary based upon the first lines of the message.
.TP .TP
\fB\-\-summary-len=<number>\fR \fB\-\-summary-len=<number>\fR
Number of lines to use for the summary. Default: 5. If > 0, use that number of lines of the message to provide a summary.
.TP .TP
\fB\-\-include\-unreadable\fR \fB\-\-include\-unreadable\fR

View File

@ -1,4 +1,4 @@
.TH MU VIEW 1 "April 2012" "User Manuals" .TH MU VIEW 1 "July 2012" "User Manuals"
.SH NAME .SH NAME
@ -21,14 +21,9 @@ any).
.SH OPTIONS .SH OPTIONS
.TP .TP
\fB\-\-summary\fR \fB\-\-summary-len\fR=\fI<number>\fR
instead of displaying the full message, output a summary based upon the first instead of displaying the full message, output a summary based upon the first
lines of the message. \fI<number>\fR lines of the message.
.TP
\fB\-\-summary-len=<number>\fR
Number of lines to use for the summary. Default: 5.
\fB\-\-terminate\fR \fB\-\-terminate\fR
terminate messaages with a \\f (\fIform-feed\fR) characters when displaying terminate messaages with a \\f (\fIform-feed\fR) characters when displaying

View File

@ -32,12 +32,8 @@
#include "mu-config.h" #include "mu-config.h"
#include "mu-cmd.h" #include "mu-cmd.h"
static MuConfig MU_CONFIG; static MuConfig MU_CONFIG;
#define DEFAULT_SUMMARY_LEN 5
static MuConfigFormat static MuConfigFormat
get_output_format (const char *formatstr) get_output_format (const char *formatstr)
{ {
@ -88,7 +84,6 @@ set_group_mu_defaults (void)
if (!isatty(fileno(stdout))) if (!isatty(fileno(stdout)))
MU_CONFIG.nocolor = TRUE; MU_CONFIG.nocolor = TRUE;
} }
static GOptionGroup* static GOptionGroup*
@ -186,19 +181,6 @@ set_group_find_defaults (void)
else else
MU_CONFIG.format = MU_CONFIG.format =
get_output_format (MU_CONFIG.formatstr); get_output_format (MU_CONFIG.formatstr);
if (MU_CONFIG.linksdir) {
gchar *old = MU_CONFIG.linksdir;
MU_CONFIG.linksdir = mu_util_dir_expand(MU_CONFIG.linksdir);
if (!MU_CONFIG.linksdir) /* we'll check the dir later */
MU_CONFIG.linksdir = old;
else
g_free(old);
}
if ((MU_CONFIG.summary && !MU_CONFIG.summary_len)||
(MU_CONFIG.summary_len < 1))
MU_CONFIG.summary_len = DEFAULT_SUMMARY_LEN;
} }
static GOptionGroup* static GOptionGroup*
@ -216,8 +198,8 @@ config_options_group_find (void)
"use a bookmarked query", NULL}, "use a bookmarked query", NULL},
{"reverse", 'z', 0, G_OPTION_ARG_NONE, &MU_CONFIG.reverse, {"reverse", 'z', 0, G_OPTION_ARG_NONE, &MU_CONFIG.reverse,
"sort in reverse (descending) order (z -> a)", NULL}, "sort in reverse (descending) order (z -> a)", NULL},
{"summary", 'k', 0, G_OPTION_ARG_NONE, &MU_CONFIG.summary, /* {"summary", 'k', 0, G_OPTION_ARG_NONE, &MU_CONFIG.summary, */
"include a short summary of the message (false)", NULL}, /* "(deprecated; use --summary-len)", NULL}, */
{"summary-len", 0, 0, G_OPTION_ARG_INT, &MU_CONFIG.summary_len, {"summary-len", 0, 0, G_OPTION_ARG_INT, &MU_CONFIG.summary_len,
"use up to <n> lines for the summary (5)", NULL}, "use up to <n> lines for the summary (5)", NULL},
{"linksdir", 0, 0, G_OPTION_ARG_STRING, &MU_CONFIG.linksdir, {"linksdir", 0, 0, G_OPTION_ARG_STRING, &MU_CONFIG.linksdir,
@ -303,10 +285,6 @@ set_group_view_defaults (void)
MU_CONFIG.format = MU_CONFIG_FORMAT_PLAIN; MU_CONFIG.format = MU_CONFIG_FORMAT_PLAIN;
else else
MU_CONFIG.format = get_output_format (MU_CONFIG.formatstr); MU_CONFIG.format = get_output_format (MU_CONFIG.formatstr);
if ((MU_CONFIG.summary && !MU_CONFIG.summary_len)||
(MU_CONFIG.summary_len < 1))
MU_CONFIG.summary_len = DEFAULT_SUMMARY_LEN;
} }
static GOptionGroup * static GOptionGroup *
@ -315,9 +293,9 @@ config_options_group_view (void)
GOptionGroup *og; GOptionGroup *og;
GOptionEntry entries[] = { GOptionEntry entries[] = {
{"summary", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.summary, {"summary", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.summary,
"only show a short summary of the message (false)", NULL}, "(deprecated; use --summary-len)", NULL},
{"summary-len", 0, 0, G_OPTION_ARG_INT, &MU_CONFIG.summary_len, /* {"summary-len", 0, 0, G_OPTION_ARG_INT, &MU_CONFIG.summary_len, */
"use up to <n> lines for the summary (5)", NULL}, /* "use up to <n> lines for the summary (5)", NULL}, */
{"terminate", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.terminator, {"terminate", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.terminator,
"terminate messages with ascii-0x07 (\\f, form-feed)", NULL}, "terminate messages with ascii-0x07 (\\f, form-feed)", NULL},
{"format", 'o', 0, G_OPTION_ARG_STRING, &MU_CONFIG.formatstr, {"format", 'o', 0, G_OPTION_ARG_STRING, &MU_CONFIG.formatstr,

View File

@ -119,7 +119,7 @@ struct _MuConfig {
gboolean reverse; /* sort in revers order (z->a) */ gboolean reverse; /* sort in revers order (z->a) */
gboolean threads; /* show message threads */ gboolean threads; /* show message threads */
gboolean summary; /* include a summary? */ gboolean summary; /* OBSOLETE: use summary_len */
int summary_len; /* max # of lines for summary */ int summary_len; /* max # of lines for summary */
char *bookmark; /* use bookmark */ char *bookmark; /* use bookmark */