From e2c0240a842f193286b070cdbc1c4bd4fd3542e9 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Sat, 11 Jul 2015 04:28:34 +0200 Subject: degesch: move the -d option to configuration --- degesch.c | 17 +++++++++++++---- 1 file 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); -- cgit v1.2.3-70-g09d2