~awn-core/awn/0.2.4

« back to all changes in this revision

Viewing changes to src/main.c

  • Committer: hay veersch
  • Date: 2008-02-18 22:55:37 UTC
  • Revision ID: h4writer@h4writer-laptop-20080218225537-acp1l8a95m8bjug3
2008-02-18  haytjes  <hv1989@gmail.com>

        * src/main.c:
        Fixed some bugs with GOptionContext

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
        guint32 ret;
128
128
 
129
129
        GOptionContext *context;
130
 
        static GOptionEntry entries[] = 
 
130
        gboolean version = FALSE;
 
131
        GOptionEntry entries[] = 
131
132
        {
132
 
                { "version", 'v', 0, G_OPTION_ARG_NONE, NULL, "Prints the version number", NULL },
 
133
                { "version", 'v', 0, G_OPTION_ARG_NONE, &version, "Prints the version number", NULL },
133
134
                { NULL }
134
135
        };
135
136
 
136
137
        context = g_option_context_new ("- Starts the Avant Window Navigator dock");
137
138
        g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
138
139
        g_option_context_add_group (context, gtk_get_option_group (TRUE));
139
 
        g_option_context_parse (context, &argc, &argv, &error);
 
140
        g_option_context_parse (context, &argc, &argv, NULL);
 
141
        g_option_context_free(context);
 
142
 
140
143
        
 
144
        if(version) {
 
145
                g_print("Avant Window Navigator ");
 
146
                g_print(VERSION);
 
147
                g_print("\n");
 
148
                return 0;
 
149
        }
 
150
 
141
151
        if (!g_thread_supported ()) g_thread_init (NULL);
142
152
        dbus_g_thread_init ();
143
 
  
 
153
 
144
154
        g_type_init ();
145
155
 
146
156
        gtk_init (&argc, &argv);