[gnome-panel/wip/segeiger/version] main.c: add a '--version' option



commit d9cc87fbb5606f5406eef6b976cf43ac963f1b02
Author: Sebastian Geiger <sbastig gmx net>
Date:   Fri Aug 21 11:27:15 2015 +0200

    main.c: add a '--version' option

 gnome-panel/main.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gnome-panel/main.c b/gnome-panel/main.c
index 4cbf604..33fd58b 100644
--- a/gnome-panel/main.c
+++ b/gnome-panel/main.c
@@ -30,10 +30,12 @@ GSList *panels = NULL;
 GSList *panel_list = NULL;
 
 static gboolean  replace = FALSE;
+static gboolean  version = FALSE;
 static GtkCssProvider *provider = NULL;
 
 static const GOptionEntry options[] = {
   { "replace", 0, 0, G_OPTION_ARG_NONE, &replace, N_("Replace a currently running panel"), NULL },
+  { "version", 0, 0, G_OPTION_ARG_NONE, &version, N_("Print version"), NULL},
   { NULL }
 };
 
@@ -128,6 +130,11 @@ main (int argc, char **argv)
 
        g_option_context_free (context);
 
+       if (version) {
+               printf("%s\n", PACKAGE " " VERSION);
+               return EXIT_SUCCESS;
+       }
+
        session = panel_session_new (replace);
        if (session == NULL)
                return 1;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]