diff -r f50c94ec0021 -r d31a4f3b547e pidgin/gtkmain.c --- a/pidgin/gtkmain.c Wed Aug 14 16:17:04 2013 +0200 +++ b/pidgin/gtkmain.c Fri Aug 16 09:29:04 2013 +0200 @@ -388,7 +388,7 @@ g_string_append_printf(str, _("Usage: %s [OPTION]...\n\n"), name); g_string_append_printf(str, " -c, --config=%s %s\n", _("DIR"), _("use DIR for config files")); - g_string_append_printf(str, " -d, --debug %s\n", + g_string_append_printf(str, " -d, --debug[=colored] %s\n", _("print debugging messages to stdout")); g_string_append_printf(str, " -f, --force-online %s\n", _("force online, regardless of network status")); @@ -458,13 +458,13 @@ #endif int opt; gboolean gui_check; - gboolean debug_enabled; + gboolean debug_enabled, debug_colored; GList *active_accounts; GStatBuf st; struct option long_options[] = { {"config", required_argument, NULL, 'c'}, - {"debug", no_argument, NULL, 'd'}, + {"debug", optional_argument, NULL, 'd'}, {"force-online", no_argument, NULL, 'f'}, {"help", no_argument, NULL, 'h'}, {"login", optional_argument, NULL, 'l'}, @@ -477,6 +477,7 @@ {0, 0, 0, 0} }; + debug_colored = FALSE; #ifdef DEBUG debug_enabled = TRUE; #else @@ -624,6 +625,8 @@ break; case 'd': /* debug */ debug_enabled = TRUE; + if (g_strcmp0(optarg, "colored") == 0) + debug_colored = TRUE; break; case 'f': /* force-online */ opt_force_online = TRUE; @@ -703,6 +706,7 @@ */ purple_debug_set_enabled(debug_enabled); + purple_debug_set_colored(debug_colored); #if !GTK_CHECK_VERSION(3,0,0) search_path = g_build_filename(purple_user_dir(), "gtkrc-2.0", NULL);