summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorGustavo F. Padovan <gustavo@padovan.org>2010-05-25 05:12:39 -0300
committerMarcel Holtmann <marcel@holtmann.org>2010-05-25 11:05:12 +0200
commitced29d3da3be06c3a772de7923504b3d9079a967 (patch)
tree7f84da503b145b57e9d6b364937ee1b564be5da6 /src/main.c
parent81cc256cb78dd57919cfbcc6598673d2797fb2f9 (diff)
downloadconnman-ced29d3da3be06c3a772de7923504b3d9079a967.tar.gz
connman-ced29d3da3be06c3a772de7923504b3d9079a967.tar.bz2
connman-ced29d3da3be06c3a772de7923504b3d9079a967.zip
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 5971af82..5818099f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -67,8 +67,19 @@ static gboolean option_compat = FALSE;
static gboolean option_selftest = FALSE;
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" },
{ "device", 'i', 0, G_OPTION_ARG_STRING, &option_device,
"Specify networking device or interface", "DEV" },