mirror of https://github.com/djcb/mu.git
* mu-config.c: cosmetics
This commit is contained in:
parent
373973d813
commit
b7e3786af7
|
@ -27,8 +27,7 @@
|
|||
#include "mu-util.h"
|
||||
#include "mu-config.h"
|
||||
|
||||
static void
|
||||
set_group_mu_defaults (MuConfigOptions *opts)
|
||||
static void set_group_mu_defaults(MuConfigOptions * opts)
|
||||
{
|
||||
gchar *exp;
|
||||
|
||||
|
@ -42,9 +41,7 @@ set_group_mu_defaults (MuConfigOptions *opts)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static GOptionGroup*
|
||||
config_options_group_mu (MuConfigOptions *opts)
|
||||
static GOptionGroup *config_options_group_mu(MuConfigOptions * opts)
|
||||
{
|
||||
GOptionGroup *og;
|
||||
GOptionEntry entries[] = {
|
||||
|
@ -63,16 +60,13 @@ config_options_group_mu (MuConfigOptions *opts)
|
|||
{NULL, 0, 0, 0, NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
og = g_option_group_new ("mu", "general mu options",
|
||||
"", NULL, NULL);
|
||||
og = g_option_group_new("mu", "general mu options", "", NULL, NULL);
|
||||
g_option_group_add_entries(og, entries);
|
||||
|
||||
return og;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
set_group_index_defaults (MuConfigOptions *opts)
|
||||
static void set_group_index_defaults(MuConfigOptions * opts)
|
||||
{
|
||||
gchar *exp;
|
||||
|
||||
|
@ -86,10 +80,7 @@ set_group_index_defaults (MuConfigOptions *opts)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static GOptionGroup*
|
||||
config_options_group_index (MuConfigOptions *opts)
|
||||
static GOptionGroup *config_options_group_index(MuConfigOptions * opts)
|
||||
{
|
||||
GOptionGroup *og;
|
||||
GOptionEntry entries[] = {
|
||||
|
@ -100,7 +91,8 @@ config_options_group_index (MuConfigOptions *opts)
|
|||
{"rebuild", 0, 0, G_OPTION_ARG_NONE, &opts->rebuild,
|
||||
"rebuild the database from scratch", NULL},
|
||||
{"autoupgrade", 0, 0, G_OPTION_ARG_NONE, &opts->autoupgrade,
|
||||
"automatically upgrade the database with new mu versions", NULL},
|
||||
"automatically upgrade the database with new mu versions",
|
||||
NULL},
|
||||
{"nocleanup", 0, 0, G_OPTION_ARG_NONE, &opts->nocleanup,
|
||||
"don't clean up the database after indexing", NULL},
|
||||
{NULL, 0, 0, 0, NULL, NULL, NULL}
|
||||
|
@ -114,9 +106,7 @@ config_options_group_index (MuConfigOptions *opts)
|
|||
return og;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
set_group_find_defaults (MuConfigOptions *opts)
|
||||
static void set_group_find_defaults(MuConfigOptions * opts)
|
||||
{
|
||||
/* note, when no fields are specified, we use
|
||||
* date-from-subject, and sort descending by date. If fields
|
||||
|
@ -143,9 +133,7 @@ set_group_find_defaults (MuConfigOptions *opts)
|
|||
opts->summary_len = 0;
|
||||
}
|
||||
|
||||
|
||||
static GOptionGroup*
|
||||
config_options_group_find (MuConfigOptions *opts)
|
||||
static GOptionGroup *config_options_group_find(MuConfigOptions * opts)
|
||||
{
|
||||
GOptionGroup *og;
|
||||
GOptionEntry entries[] = {
|
||||
|
@ -176,10 +164,7 @@ config_options_group_find (MuConfigOptions *opts)
|
|||
return og;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static GOptionGroup*
|
||||
config_options_group_mkdir (MuConfigOptions *opts)
|
||||
static GOptionGroup *config_options_group_mkdir(MuConfigOptions * opts)
|
||||
{
|
||||
GOptionGroup *og;
|
||||
GOptionEntry entries[] = {
|
||||
|
@ -199,9 +184,7 @@ config_options_group_mkdir (MuConfigOptions *opts)
|
|||
return og;
|
||||
}
|
||||
|
||||
|
||||
static GOptionGroup*
|
||||
config_options_group_extract (MuConfigOptions *opts)
|
||||
static GOptionGroup *config_options_group_extract(MuConfigOptions * opts)
|
||||
{
|
||||
GOptionGroup *og;
|
||||
GOptionEntry entries[] = {
|
||||
|
@ -229,12 +212,7 @@ config_options_group_extract (MuConfigOptions *opts)
|
|||
return og;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static gboolean
|
||||
parse_params (MuConfigOptions *opts, int *argcp, char ***argvp)
|
||||
static gboolean parse_params(MuConfigOptions * opts, int *argcp, char ***argvp)
|
||||
{
|
||||
GError *err;
|
||||
GOptionContext *context;
|
||||
|
@ -242,16 +220,11 @@ parse_params (MuConfigOptions *opts, int *argcp, char ***argvp)
|
|||
|
||||
context = g_option_context_new("- mu general option");
|
||||
|
||||
g_option_context_set_main_group (context,
|
||||
config_options_group_mu (opts));
|
||||
g_option_context_add_group (context,
|
||||
config_options_group_index (opts));
|
||||
g_option_context_add_group (context,
|
||||
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));
|
||||
g_option_context_set_main_group(context, config_options_group_mu(opts));
|
||||
g_option_context_add_group(context, config_options_group_index(opts));
|
||||
g_option_context_add_group(context, 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));
|
||||
|
||||
err = NULL;
|
||||
rv = g_option_context_parse(context, argcp, argvp, &err);
|
||||
|
@ -271,9 +244,7 @@ parse_params (MuConfigOptions *opts, int *argcp, char ***argvp)
|
|||
return rv;
|
||||
}
|
||||
|
||||
|
||||
gboolean
|
||||
mu_config_init (MuConfigOptions *opts, int *argcp, char ***argvp)
|
||||
gboolean mu_config_init(MuConfigOptions * opts, int *argcp, char ***argvp)
|
||||
{
|
||||
g_return_val_if_fail(opts, FALSE);
|
||||
memset(opts, 0, sizeof(MuConfigOptions));
|
||||
|
@ -287,8 +258,7 @@ mu_config_init (MuConfigOptions *opts, int *argcp, char ***argvp)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
mu_config_uninit (MuConfigOptions *opts)
|
||||
void mu_config_uninit(MuConfigOptions * opts)
|
||||
{
|
||||
g_return_if_fail(opts);
|
||||
|
||||
|
@ -299,5 +269,3 @@ mu_config_uninit (MuConfigOptions *opts)
|
|||
|
||||
g_strfreev(opts->params);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue