From 5d7869453a1c2305291bedcb2edf5e567bbcb5b8 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Wed, 2 Jun 2010 21:19:48 +0800 Subject: [PATCH] Add --version -V option for ibus-daemon --- bus/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bus/main.c b/bus/main.c index 19a732a..b100d2a 100644 --- a/bus/main.c +++ b/bus/main.c @@ -48,8 +48,16 @@ gint g_dbus_timeout = 5000; gint g_monitor_timeout = 0; #endif +static void +show_version_and_quit (void) +{ + g_print ("%s - Version %s\n", g_get_application_name (), VERSION); + exit (EXIT_SUCCESS); +} + static const GOptionEntry entries[] = { + { "version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, show_version_and_quit, "Show the application's version.", NULL }, { "daemonize", 'd', 0, G_OPTION_ARG_NONE, &daemonize, "run ibus as background process.", NULL }, { "single", 's', 0, G_OPTION_ARG_NONE, &single, "do not execute panel and config module.", NULL }, { "xim", 'x', 0, G_OPTION_ARG_NONE, &xim, "execute ibus XIM server.", NULL }, -- 2.7.4