3 * Purple is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
28 /******************************************************************************
30 *****************************************************************************/
32 debug_cb(const gchar
*option_name
, const gchar
*value
,
33 gpointer data
, GError
**error
)
35 purple_debug_set_enabled(TRUE
);
37 if (purple_strequal(value
, "colored")) {
38 purple_debug_set_colored(TRUE
);
45 force_online_cb(const gchar
*option_name
, const gchar
*value
,
46 gpointer data
, GError
**error
)
48 purple_network_force_online();
53 /******************************************************************************
55 *****************************************************************************/
58 * purple_get_option_group:
60 * Returns a #GOptionGroup for the commandline arguments recognized by
61 * LibPurple. You should add this option group to your #GOptionContext with
62 * g_option_context_add_group(), if you are using g_option_context_parse() to
63 * parse your commandline arguments.
65 * Return Value: (transfer full): a #GOptionGroup for the commandline arguments
66 * recognized by LibPurple.
69 purple_get_option_group(void) {
70 GOptionGroup
*group
= NULL
;
71 GOptionEntry entries
[] = {
73 "debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG
,
74 G_OPTION_ARG_CALLBACK
, &debug_cb
,
75 _("print debugging messages to stdout"),
78 "force-online", 'f', G_OPTION_FLAG_NO_ARG
,
79 G_OPTION_ARG_CALLBACK
, &force_online_cb
,
80 _("force online, regardless of network status"),
87 group
= g_option_group_new(
89 _("LibPurple options"),
90 _("Show LibPurple Options"),
95 g_option_group_add_entries(group
, entries
);