diff options
author | Gustavo F. Padovan <gustavo@padovan.org> | 2010-05-25 05:12:39 -0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-05-25 11:05:12 +0200 |
commit | ced29d3da3be06c3a772de7923504b3d9079a967 (patch) | |
tree | 7f84da503b145b57e9d6b364937ee1b564be5da6 /src/main.c | |
parent | 81cc256cb78dd57919cfbcc6598673d2797fb2f9 (diff) | |
download | connman-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.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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" }, |