* mu-config: add some config options for mu extract
This commit is contained in:
@ -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
|
static gboolean
|
||||||
parse_params (MuConfigOptions *opts, int *argcp, char ***argvp)
|
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));
|
config_options_group_find (opts));
|
||||||
g_option_context_add_group (context,
|
g_option_context_add_group (context,
|
||||||
config_options_group_mkdir (opts));
|
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);
|
rv = g_option_context_parse (context, argcp, argvp, &error);
|
||||||
if (!rv) {
|
if (!rv) {
|
||||||
|
|||||||
@ -48,7 +48,6 @@ struct _MuConfigOptions {
|
|||||||
gboolean rebuild; /* empty the database before indexing */
|
gboolean rebuild; /* empty the database before indexing */
|
||||||
gboolean autoupgrade; /* automatically upgrade db
|
gboolean autoupgrade; /* automatically upgrade db
|
||||||
* when needed */
|
* when needed */
|
||||||
|
|
||||||
/* options for querying */
|
/* options for querying */
|
||||||
gboolean xquery; /* give the Xapian query instead of
|
gboolean xquery; /* give the Xapian query instead of
|
||||||
search results */
|
search results */
|
||||||
@ -56,11 +55,15 @@ struct _MuConfigOptions {
|
|||||||
char *sortfield; /* field to sort by (string) */
|
char *sortfield; /* field to sort by (string) */
|
||||||
gboolean descending; /* sort descending? */
|
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 */
|
/* output to a maildir with symlinks */
|
||||||
char *linksdir; /* maildir to output symlinks */
|
char *linksdir; /* maildir to output symlinks */
|
||||||
gboolean clearlinks; /* clear a linksdir before filling */
|
gboolean clearlinks; /* clear a linksdir before filling */
|
||||||
mode_t dirmode; /* mode for the created maildir */
|
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;
|
typedef struct _MuConfigOptions MuConfigOptions;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user