diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2013-05-17 18:26:08 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2013-05-17 18:41:14 +0200 |
commit | 9c024a57cd43eb10079cb2728a25c76f1a2a967c (patch) | |
tree | 787f6c742c553381d08dabbcf42360a471c976c3 /src | |
parent | 156e12c456a79376e3409dca910d02027e660a2f (diff) | |
download | tdv-9c024a57cd43eb10079cb2728a25c76f1a2a967c.tar.gz tdv-9c024a57cd43eb10079cb2728a25c76f1a2a967c.tar.xz tdv-9c024a57cd43eb10079cb2728a25c76f1a2a967c.zip |
Add CMake infrastructure
Diffstat (limited to 'src')
-rw-r--r-- | src/sdtui.c | 13 |
1 files changed, 12 insertions, 1 deletions
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 <errno.h> #include <signal.h> +#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); |