From: Gustavo F. Padovan Date: Tue, 25 May 2010 08:09:21 +0000 (-0300) Subject: Bring back -d option without need for argument X-Git-Tag: 0.21~66 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d62548bfd0e63f6b035a26131017a7c7eaaf3cca;p=platform%2Fupstream%2Fofono.git Bring back -d option without need for argument --- diff --git a/src/main.c b/src/main.c index 8e686ac..8f4092c 100644 --- a/src/main.c +++ b/src/main.c @@ -96,8 +96,19 @@ static gchar *option_debug = NULL; static gboolean option_detach = TRUE; static gboolean option_version = FALSE; +static gboolean parse_debug(const char *key, const char *value, gpointer user_data, GError **error) +{ + if (value) + option_debug = g_strdup(value); + else + option_debug = g_strdup("*"); + + return TRUE; +} + static GOptionEntry options[] = { - { "debug", 'd', 0, G_OPTION_ARG_STRING, &option_debug, + { "debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG, + G_OPTION_ARG_CALLBACK, parse_debug, "Specify debug options to enable", "DEBUG" }, { "nodetach", 'n', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &option_detach,