pidgin/gtkmain.c

changeset 34296
d31a4f3b547e
parent 34293
c1da9082287f
child 34308
cdb187c27360
child 34883
7d9d0d7b7b62
equal deleted inserted replaced
34295:f50c94ec0021 34296:d31a4f3b547e
386 GString *str = g_string_new(NULL); 386 GString *str = g_string_new(NULL);
387 g_string_append_printf(str, "%s %s\n", PIDGIN_NAME, DISPLAY_VERSION); 387 g_string_append_printf(str, "%s %s\n", PIDGIN_NAME, DISPLAY_VERSION);
388 g_string_append_printf(str, _("Usage: %s [OPTION]...\n\n"), name); 388 g_string_append_printf(str, _("Usage: %s [OPTION]...\n\n"), name);
389 g_string_append_printf(str, " -c, --config=%s %s\n", 389 g_string_append_printf(str, " -c, --config=%s %s\n",
390 _("DIR"), _("use DIR for config files")); 390 _("DIR"), _("use DIR for config files"));
391 g_string_append_printf(str, " -d, --debug %s\n", 391 g_string_append_printf(str, " -d, --debug[=colored] %s\n",
392 _("print debugging messages to stdout")); 392 _("print debugging messages to stdout"));
393 g_string_append_printf(str, " -f, --force-online %s\n", 393 g_string_append_printf(str, " -f, --force-online %s\n",
394 _("force online, regardless of network status")); 394 _("force online, regardless of network status"));
395 g_string_append_printf(str, " -h, --help %s\n", 395 g_string_append_printf(str, " -h, --help %s\n",
396 _("display this help and exit")); 396 _("display this help and exit"));
456 #if defined(HAVE_SIGNAL_H) || GTK_CHECK_VERSION(3,0,0) 456 #if defined(HAVE_SIGNAL_H) || GTK_CHECK_VERSION(3,0,0)
457 GError *error; 457 GError *error;
458 #endif 458 #endif
459 int opt; 459 int opt;
460 gboolean gui_check; 460 gboolean gui_check;
461 gboolean debug_enabled; 461 gboolean debug_enabled, debug_colored;
462 GList *active_accounts; 462 GList *active_accounts;
463 GStatBuf st; 463 GStatBuf st;
464 464
465 struct option long_options[] = { 465 struct option long_options[] = {
466 {"config", required_argument, NULL, 'c'}, 466 {"config", required_argument, NULL, 'c'},
467 {"debug", no_argument, NULL, 'd'}, 467 {"debug", optional_argument, NULL, 'd'},
468 {"force-online", no_argument, NULL, 'f'}, 468 {"force-online", no_argument, NULL, 'f'},
469 {"help", no_argument, NULL, 'h'}, 469 {"help", no_argument, NULL, 'h'},
470 {"login", optional_argument, NULL, 'l'}, 470 {"login", optional_argument, NULL, 'l'},
471 {"multiple", no_argument, NULL, 'm'}, 471 {"multiple", no_argument, NULL, 'm'},
472 {"nologin", no_argument, NULL, 'n'}, 472 {"nologin", no_argument, NULL, 'n'},
475 {"display", required_argument, NULL, 'D'}, 475 {"display", required_argument, NULL, 'D'},
476 {"sync", no_argument, NULL, 'S'}, 476 {"sync", no_argument, NULL, 'S'},
477 {0, 0, 0, 0} 477 {0, 0, 0, 0}
478 }; 478 };
479 479
480 debug_colored = FALSE;
480 #ifdef DEBUG 481 #ifdef DEBUG
481 debug_enabled = TRUE; 482 debug_enabled = TRUE;
482 #else 483 #else
483 debug_enabled = FALSE; 484 debug_enabled = FALSE;
484 #endif 485 #endif
622 g_free(opt_config_dir_arg); 623 g_free(opt_config_dir_arg);
623 opt_config_dir_arg = g_strdup(optarg); 624 opt_config_dir_arg = g_strdup(optarg);
624 break; 625 break;
625 case 'd': /* debug */ 626 case 'd': /* debug */
626 debug_enabled = TRUE; 627 debug_enabled = TRUE;
628 if (g_strcmp0(optarg, "colored") == 0)
629 debug_colored = TRUE;
627 break; 630 break;
628 case 'f': /* force-online */ 631 case 'f': /* force-online */
629 opt_force_online = TRUE; 632 opt_force_online = TRUE;
630 break; 633 break;
631 case 'h': /* help */ 634 case 'h': /* help */
701 * We're done piddling around with command line arguments. 704 * We're done piddling around with command line arguments.
702 * Fire up this baby. 705 * Fire up this baby.
703 */ 706 */
704 707
705 purple_debug_set_enabled(debug_enabled); 708 purple_debug_set_enabled(debug_enabled);
709 purple_debug_set_colored(debug_colored);
706 710
707 #if !GTK_CHECK_VERSION(3,0,0) 711 #if !GTK_CHECK_VERSION(3,0,0)
708 search_path = g_build_filename(purple_user_dir(), "gtkrc-2.0", NULL); 712 search_path = g_build_filename(purple_user_dir(), "gtkrc-2.0", NULL);
709 gtk_rc_add_default_file(search_path); 713 gtk_rc_add_default_file(search_path);
710 g_free(search_path); 714 g_free(search_path);

mercurial