* add the --summary-len options (defaults at zero)

(the '--summary' option has been removed, instead it's implied from
summary-len > 0)
This commit is contained in:
djcb 2010-08-15 14:58:34 +03:00
parent 9e24a093a7
commit 00212179f1
2 changed files with 5 additions and 6 deletions

View File

@ -74,9 +74,7 @@ config_options_group_mu (MuConfigOptions *opts)
{ NULL, 0, 0, 0, NULL, NULL, NULL } { NULL, 0, 0, 0, NULL, NULL, NULL }
}; };
og = g_option_group_new ("mu", "general mu options",
og = g_option_group_new ("mu",
"general mu options",
"", NULL, NULL); "", NULL, NULL);
g_option_group_add_entries (og, entries); g_option_group_add_entries (og, entries);
@ -145,6 +143,10 @@ set_group_find_defaults (MuConfigOptions *opts)
opts->linksdir = mu_util_dir_expand (opts->linksdir); opts->linksdir = mu_util_dir_expand (opts->linksdir);
g_free(old); g_free(old);
} }
/* FIXME: some warning when summary_len < 0? */
if (opts->summary_len < 1)
opts->summary_len = 0;
} }
@ -161,8 +163,6 @@ config_options_group_find (MuConfigOptions *opts)
"field to sort on", NULL}, "field to sort on", NULL},
{"descending", 'z', 0, G_OPTION_ARG_NONE, &opts->descending, {"descending", 'z', 0, G_OPTION_ARG_NONE, &opts->descending,
"sort in descending order (z -> a)", NULL}, "sort in descending order (z -> a)", NULL},
{"summary", 'j', 0, G_OPTION_ARG_NONE, &opts->summary,
"output summary of message", NULL},
{"summary-len", 'k', 0, G_OPTION_ARG_INT, &opts->summary_len, {"summary-len", 'k', 0, G_OPTION_ARG_INT, &opts->summary_len,
"max number of lines for summary", NULL}, "max number of lines for summary", NULL},
{"linksdir", 'l', 0, G_OPTION_ARG_STRING, &opts->linksdir, {"linksdir", 'l', 0, G_OPTION_ARG_STRING, &opts->linksdir,

View File

@ -55,7 +55,6 @@ struct _MuConfigOptions {
char *fields; /* fields to show in output */ char *fields; /* fields to show in output */
char *sortfield; /* field to sort by (string) */ char *sortfield; /* field to sort by (string) */
gboolean descending; /* sort descending? */ gboolean descending; /* sort descending? */
gboolean summary; /* output summary of mail */
unsigned summary_len; /* max # of lines of msg in summary */ unsigned summary_len; /* max # of lines of msg in summary */
/* output to a maildir with symlinks */ /* output to a maildir with symlinks */