summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2011-01-19 13:43:48 -0600
committerStef Walter <stef@memberwebs.com>2011-01-19 13:51:15 -0600
commit1cc7a50700866fbec45916f33031a3fd063cfbe7 (patch)
treebe5162491d54b5d3386422615f8a2c51b5c36025 /tool
parent6fdf533b5141398a190ce72f3e3e71140c3de12c (diff)
downloadgnome-keyring-1cc7a50700866fbec45916f33031a3fd063cfbe7.tar.gz
Add support for --version to gnome-keyring-daemon and gnome-keyring
* Machine readable output. * gnome-keyring version * gnome-keyring-daemon --version
Diffstat (limited to 'tool')
-rw-r--r--tool/Makefile.am3
-rw-r--r--tool/gkr-tool-version.c48
-rw-r--r--tool/gkr-tool.c3
-rw-r--r--tool/gkr-tool.h5
4 files changed, 56 insertions, 3 deletions
diff --git a/tool/Makefile.am b/tool/Makefile.am
index 441939ec..2960e89f 100644
--- a/tool/Makefile.am
+++ b/tool/Makefile.am
@@ -12,7 +12,8 @@ INCLUDES= \
gnome_keyring@GCR_VERSION_SUFFIX@_SOURCES = \
gkr-tool.c gkr-tool.h \
gkr-tool-import.c \
- gkr-tool-trust.c
+ gkr-tool-trust.c \
+ gkr-tool-version.c
gnome_keyring@GCR_VERSION_SUFFIX@_CFLAGS = \
-DGCR_API_SUBJECT_TO_CHANGE \
diff --git a/tool/gkr-tool-version.c b/tool/gkr-tool-version.c
new file mode 100644
index 00000000..dc1a4149
--- /dev/null
+++ b/tool/gkr-tool-version.c
@@ -0,0 +1,48 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* gkr-tool-version.c: Version display
+
+ Copyright (C) 2011 Collabora Ltd.
+
+ The Gnome Keyring Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The Gnome Keyring Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the Gnome Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+ Author: Stef Walter <stef@memberwebs.com>
+*/
+
+#include "config.h"
+
+#include "gkr-tool.h"
+
+#include "gck/gck.h"
+#include "gcr/gcr.h"
+
+#include "egg/egg-hex.h"
+
+static GOptionEntry version_entries[] = {
+ { NULL }
+};
+
+int
+gkr_tool_version (int argc, char *argv[])
+{
+ int ret;
+
+ ret = gkr_tool_parse_options (&argc, &argv, version_entries);
+ if (ret != 0)
+ return ret;
+
+ g_print ("gnome-keyring: %s\n", VERSION);
+ return 0;
+}
diff --git a/tool/gkr-tool.c b/tool/gkr-tool.c
index 030fb992..73aac6db 100644
--- a/tool/gkr-tool.c
+++ b/tool/gkr-tool.c
@@ -87,8 +87,9 @@ typedef struct _CommandInfo {
} CommandInfo;
static CommandInfo command_info[] = {
- { "import", gkr_tool_import },
{ "certificate-exception", gkr_tool_trust },
+ { "import", gkr_tool_import },
+ { "version", gkr_tool_version },
{ NULL, NULL }
};
diff --git a/tool/gkr-tool.h b/tool/gkr-tool.h
index 217db114..c3a7d186 100644
--- a/tool/gkr-tool.h
+++ b/tool/gkr-tool.h
@@ -44,6 +44,9 @@ int gkr_tool_parse_options (int *argc, char** argv[], GOptionEntry *options);
*/
int gkr_tool_import (int argc, char *argv[]);
-int gkr_tool_trust (int argc, char *argv[]);
+
+int gkr_tool_trust (int argc, char *argv[]);
+
+int gkr_tool_version (int argc, char *argv[]);
#endif /* GKRTOOL_H_ */