summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorGustavo F. Padovan <gustavo@padovan.org>2010-05-25 05:09:21 -0300
committerMarcel Holtmann <marcel@holtmann.org>2010-05-25 11:08:22 +0200
commitd62548bfd0e63f6b035a26131017a7c7eaaf3cca (patch)
tree00ce947455adb9ddf5c84f81b12419d8dfda5c9c /src/main.c
parent1ec9c6c3b687c9200d1c68a2722801a24b9a7299 (diff)
downloadofono-d62548bfd0e63f6b035a26131017a7c7eaaf3cca.tar.bz2
Bring back -d option without need for argument
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 8e686ac7..8f4092cd 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,