aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-12-08 21:58:08 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-12-08 21:58:08 +0800
commit2f32e1cc68cd416f4530ecc3d2ff08b0e6498d45 (patch)
tree7a3b4043cfa7af31ef83f182fb8bdfba2554027e
parent8e4fb289d9bc49774d13ff6f97367ebd3b5cf480 (diff)
downloadgsoc2013-evolution-2f32e1cc68cd416f4530ecc3d2ff08b0e6498d45.tar
gsoc2013-evolution-2f32e1cc68cd416f4530ecc3d2ff08b0e6498d45.tar.gz
gsoc2013-evolution-2f32e1cc68cd416f4530ecc3d2ff08b0e6498d45.tar.bz2
gsoc2013-evolution-2f32e1cc68cd416f4530ecc3d2ff08b0e6498d45.tar.lz
gsoc2013-evolution-2f32e1cc68cd416f4530ecc3d2ff08b0e6498d45.tar.xz
gsoc2013-evolution-2f32e1cc68cd416f4530ecc3d2ff08b0e6498d45.tar.zst
gsoc2013-evolution-2f32e1cc68cd416f4530ecc3d2ff08b0e6498d45.zip
Add a hidden --version option.
Required by GNU Coding Standards.
-rw-r--r--shell/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/shell/main.c b/shell/main.c
index c8ce8a014a..768180234c 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -281,6 +281,17 @@ handle_term_signal (gpointer data)
}
#endif
+G_GNUC_NORETURN static gboolean
+option_version_cb (const gchar *option_name,
+ const gchar *option_value,
+ gpointer data,
+ GError **error)
+{
+ g_print ("%s\n", PACKAGE_STRING);
+
+ exit (0);
+}
+
static GOptionEntry entries[] = {
#ifdef G_OS_WIN32
{ "register-handlers", '\0', G_OPTION_FLAG_HIDDEN,
@@ -326,6 +337,8 @@ static GOptionEntry entries[] = {
N_("Import URIs or file names given as rest of arguments."), NULL },
{ "quit", 'q', 0, G_OPTION_ARG_NONE, &quit,
N_("Request a running Evolution process to quit"), NULL },
+ { "version", 'v', G_OPTION_FLAG_HIDDEN | G_OPTION_FLAG_NO_ARG,
+ G_OPTION_ARG_CALLBACK, option_version_cb, NULL, NULL },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY,
&remaining_args, NULL, NULL },
{ NULL }