cmdline: Add --no-config to explicitly set daemon default options.
This commit is contained in:
@@ -81,7 +81,8 @@ void parseOptions(int argc, char **argv, Options *options)
|
|||||||
GOptionContext *context;
|
GOptionContext *context;
|
||||||
bool ret;
|
bool ret;
|
||||||
static gboolean option_version,
|
static gboolean option_version,
|
||||||
option_create_db, option_no_create_db, option_no_daemon;
|
option_create_db, option_no_create_db, option_no_daemon,
|
||||||
|
option_no_config;
|
||||||
const GOptionEntry entries[] = {
|
const GOptionEntry entries[] = {
|
||||||
{ "version", 'V', 0, G_OPTION_ARG_NONE, &option_version,
|
{ "version", 'V', 0, G_OPTION_ARG_NONE, &option_version,
|
||||||
"print version number", NULL },
|
"print version number", NULL },
|
||||||
@@ -97,6 +98,8 @@ void parseOptions(int argc, char **argv, Options *options)
|
|||||||
"print messages to stderr", NULL },
|
"print messages to stderr", NULL },
|
||||||
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &options->verbose,
|
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &options->verbose,
|
||||||
"verbose logging", NULL },
|
"verbose logging", NULL },
|
||||||
|
{ "no-config", 0, 0, G_OPTION_ARG_NONE, &option_no_config,
|
||||||
|
"don't read from config", NULL },
|
||||||
{ .long_name = NULL }
|
{ .long_name = NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -138,7 +141,9 @@ void parseOptions(int argc, char **argv, Options *options)
|
|||||||
|
|
||||||
options->daemon = !option_no_daemon;
|
options->daemon = !option_no_daemon;
|
||||||
|
|
||||||
if (argc <= 1) {
|
if (option_no_config) {
|
||||||
|
g_debug("Ignoring config, using daemon defaults\n");
|
||||||
|
} else if (argc <= 1) {
|
||||||
/* default configuration file path */
|
/* default configuration file path */
|
||||||
char *path1;
|
char *path1;
|
||||||
char *path2;
|
char *path2;
|
||||||
|
Reference in New Issue
Block a user