summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Tarricone <brian@tarricone.org>2007-10-03 12:43:08 +0000
committerBrian Tarricone <brian@tarricone.org>2007-10-03 12:43:08 +0000
commitd4c6e594200fea84e7bde4b903e9bc79b923fa2c (patch)
treeab1e9c6fc832d6020fb266b02fdabe6aa28e83c0
parent6e3eb9e521c7ca454af781ef55b43d1c32088bff (diff)
downloadxfconf-d4c6e594200fea84e7bde4b903e9bc79b923fa2c.tar.gz
add --version option
(Old svn revision: 26763)
-rw-r--r--xfconfd/main.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/xfconfd/main.c b/xfconfd/main.c
index b7ec10e..db96c9c 100644
--- a/xfconfd/main.c
+++ b/xfconfd/main.c
@@ -120,7 +120,10 @@ main(int argc,
GOptionContext *opt_ctx;
gchar **backends = NULL;
+ gboolean print_version = FALSE;
GOptionEntry options[] = {
+ { "version", 'V', 0, G_OPTION_ARG_NONE, NULL,
+ N_("Prints the xfconfd version"), NULL },
{ "backends", 'b', 0, G_OPTION_ARG_STRING_ARRAY, NULL,
N_("Configuration backends to use. The first backend specified " \
"is opened read/write; the others, read-only."), NULL },
@@ -146,18 +149,25 @@ main(int argc,
g_set_prgname("xfconfd");
g_type_init();
- options[0].arg_data = &backends;
+ options[0].arg_data = &print_version;
+ options[1].arg_data = &backends;
- opt_ctx = g_option_context_new(N_("Xfce configuration daemon"));
+ opt_ctx = g_option_context_new(NULL);
g_option_context_set_translation_domain(opt_ctx, PACKAGE);
+ g_option_context_set_summary(opt_ctx, N_("Xfce configuration daemon"));
g_option_context_set_description(opt_ctx,
- N_("Report bugs to http://bugs.xfce.org/"));
+ N_("Report bugs to http://bugs.xfce.org/\n"));
g_option_context_add_main_entries(opt_ctx, options, PACKAGE);
if(!g_option_context_parse(opt_ctx, &argc, &argv, &error)) {
g_printerr("Error parsing options: %s\n", error->message);
return 1;
}
+ if(print_version) {
+ g_print("Xfconfd version " VERSION "\n");
+ return 0;
+ }
+
mloop = g_main_loop_new(NULL, FALSE);
if(pipe(signal_pipe))