From 9c024a57cd43eb10079cb2728a25c76f1a2a967c Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Fri, 17 May 2013 18:26:08 +0200 Subject: Add CMake infrastructure --- src/sdtui.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/sdtui.c') diff --git a/src/sdtui.c b/src/sdtui.c index fa3a291..ff795ea 100644 --- a/src/sdtui.c +++ b/src/sdtui.c @@ -37,6 +37,7 @@ #include #include +#include "config.h" #include "stardict.h" @@ -849,8 +850,12 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_type_init (); G_GNUC_END_IGNORE_DEPRECATIONS - static GOptionEntry entries[] = + gboolean show_version = FALSE; + GOptionEntry entries[] = { + { "version", 0, G_OPTION_FLAG_IN_MAIN, + G_OPTION_ARG_NONE, &show_version, + "Output version information and exit", NULL }, { NULL } }; @@ -868,6 +873,12 @@ G_GNUC_END_IGNORE_DEPRECATIONS exit (EXIT_FAILURE); } + if (show_version) + { + g_print (PROJECT_NAME " " PROJECT_VERSION "\n"); + exit (EXIT_SUCCESS); + } + if (argc != 2) { gchar *help = g_option_context_get_help (ctx, TRUE, FALSE); -- cgit v1.2.3-70-g09d2