* mu-config: add some config options for mu extract

This commit is contained in:
Dirk-Jan C. Binnema 2010-08-29 16:30:55 +03:00
parent 01ff6d4fc1
commit d5329d3696
2 changed files with 33 additions and 3 deletions

View File

@ -206,6 +206,31 @@ config_options_group_mkdir (MuConfigOptions *opts)
}
static GOptionGroup*
config_options_group_extract (MuConfigOptions *opts)
{
GOptionGroup *og;
GOptionEntry entries[] = {
{"all", 0, 0, G_OPTION_ARG_NONE, &opts->all,
"extract all attachments", NULL},
{"all-parts", 0, 0, G_OPTION_ARG_NONE, &opts->all_parts,
"extract all parts (incl. non-attachments)", NULL},
{"target-dir", 0, 0, G_OPTION_ARG_STRING, &opts->targetdir,
"target directory for saving", NULL},
{ NULL, 0, 0, 0, NULL, NULL, NULL }
};
og = g_option_group_new ("extract",
"options for the 'extract' command",
"", NULL, NULL);
g_option_group_add_entries (og, entries);
return og;
}
static gboolean
parse_params (MuConfigOptions *opts, int *argcp, char ***argvp)
@ -224,6 +249,8 @@ parse_params (MuConfigOptions *opts, int *argcp, char ***argvp)
config_options_group_find (opts));
g_option_context_add_group (context,
config_options_group_mkdir (opts));
g_option_context_add_group (context,
config_options_group_extract (opts));
rv = g_option_context_parse (context, argcp, argvp, &error);
if (!rv) {

View File

@ -48,19 +48,22 @@ struct _MuConfigOptions {
gboolean rebuild; /* empty the database before indexing */
gboolean autoupgrade; /* automatically upgrade db
* when needed */
/* options for querying */
gboolean xquery; /* give the Xapian query instead of
search results */
char *fields; /* fields to show in output */
char *sortfield; /* field to sort by (string) */
gboolean descending; /* sort descending? */
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 */
char *linksdir; /* maildir to output symlinks */
gboolean clearlinks; /* clear a linksdir before filling */
mode_t dirmode; /* mode for the created maildir */
/* options for extracting parts */
gboolean *all_parts; /* extract all parts */
gboolean *all; /* extract all attachments */
char *targetdir; /* where to save the attachments */
};
typedef struct _MuConfigOptions MuConfigOptions;