[gnome-flashback/wip/version] main: add --version option
- From: Sebastian Geiger <segeiger src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback/wip/version] main: add --version option
- Date: Sat, 8 Dec 2018 17:14:01 +0000 (UTC)
commit 5b50eacedacda4fbbad13bf383821b4002a91eaa
Author: Sebastian Geiger <sbastig gmx net>
Date: Sat Dec 8 10:47:50 2018 +0100
main: add --version option
gnome-flashback/gf-main.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/gnome-flashback/gf-main.c b/gnome-flashback/gf-main.c
index 95444e2..eebd53c 100644
--- a/gnome-flashback/gf-main.c
+++ b/gnome-flashback/gf-main.c
@@ -31,6 +31,7 @@ static GfApplication *application = NULL;
static gboolean debug = FALSE;
static gboolean initialize = FALSE;
static gboolean replace = FALSE;
+static gboolean version = FALSE;
static GOptionEntry entries[] =
{
@@ -52,6 +53,12 @@ static GOptionEntry entries[] =
N_("Replace a currently running application"),
NULL
},
+ {
+ "version", 'v', G_OPTION_FLAG_NONE,
+ G_OPTION_ARG_NONE, &version,
+ N_("Print version and exit"),
+ NULL
+ },
{
NULL
}
@@ -157,6 +164,13 @@ main (int argc, char *argv[])
if (!parse_arguments (&argc, &argv))
return EXIT_FAILURE;
+ if (version)
+ {
+ g_print (PACKAGE_STRING "\n");
+
+ return EXIT_FAILURE;
+ }
+
loop = g_main_loop_new (NULL, FALSE);
session = gf_session_new (replace, session_ready_cb, session_end_cb, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]