summaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-07-11 04:28:34 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-07-11 04:28:34 +0200
commite2c0240a842f193286b070cdbc1c4bd4fd3542e9 (patch)
tree9068e51c10b41ca128bf4f7ce0bd0f9aec6afffc /degesch.c
parent8f587117f7f708867d7a0ef12bdcf1eb3327e62f (diff)
downloadxK-e2c0240a842f193286b070cdbc1c4bd4fd3542e9.tar.gz
xK-e2c0240a842f193286b070cdbc1c4bd4fd3542e9.tar.xz
xK-e2c0240a842f193286b070cdbc1c4bd4fd3542e9.zip
degesch: move the -d option to configuration
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/degesch.c b/degesch.c
index 38cb9c2..5d5108e 100644
--- a/degesch.c
+++ b/degesch.c
@@ -1414,6 +1414,12 @@ static void refresh_prompt (struct app_context *ctx);
// --- Configuration -----------------------------------------------------------
+static void
+on_config_debug_mode_change (struct config_item_ *item)
+{
+ g_debug_mode = item->value.boolean;
+}
+
static void on_config_attribute_change (struct config_item_ *item);
static void on_config_logging_change (struct config_item_ *item);
@@ -1428,6 +1434,8 @@ static void on_config_logging_change (struct config_item_ *item);
TRIVIAL_BOOLEAN_ON_CHANGE (isolate_buffers)
TRIVIAL_BOOLEAN_ON_CHANGE (beep_on_highlight)
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
static bool
config_validate_nonjunk_string
(const struct config_item_ *item, struct error **e)
@@ -1582,6 +1590,11 @@ static struct config_schema g_config_behaviour[] =
.comment = "Save configuration before quitting",
.type = CONFIG_ITEM_BOOLEAN,
.default_ = "on" },
+ { .name = "debug_mode",
+ .comment = "Produce some debugging output",
+ .type = CONFIG_ITEM_BOOLEAN,
+ .default_ = "off",
+ .on_change = on_config_debug_mode_change },
{}
};
@@ -8997,7 +9010,6 @@ main (int argc, char *argv[])
static const struct opt opts[] =
{
- { 'd', "debug", NULL, 0, "run in debug mode" },
{ 'h', "help", NULL, 0, "display this help and exit" },
{ 'V', "version", NULL, 0, "output version information and exit" },
{ 0, NULL, NULL, 0, NULL }
@@ -9010,9 +9022,6 @@ main (int argc, char *argv[])
while ((c = opt_handler_get (&oh)) != -1)
switch (c)
{
- case 'd':
- g_debug_mode = true;
- break;
case 'h':
opt_handler_usage (&oh, stdout);
exit (EXIT_SUCCESS);