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