From fd86615549a76c050dbcb50deaefde199d8216c7 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 22 Mar 2015 00:29:57 +0000 Subject: Added /pgp libver command --- src/command/command.c | 9 ++++++--- src/command/commands.c | 10 ++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'src/command') diff --git a/src/command/command.c b/src/command/command.c index a8eb362b..820ca058 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -850,10 +850,12 @@ static struct cmd_t command_defs[] = { "/pgp", cmd_pgp, parse_args, 1, 1, NULL, - { "/pgp keys", "Open PGP.", - { "/pgp keys", - "---------", + { "/pgp keys|libver", "Open PGP.", + { "/pgp keys|libver", + "----------------", "Open PGP.", + "keys : List private keys." + "libver : Show which version of the libgpgme library is being used.", NULL } } }, { "/otr", @@ -1575,6 +1577,7 @@ cmd_init(void) pgp_ac = autocomplete_new(); autocomplete_add(pgp_ac, "keys"); + autocomplete_add(pgp_ac, "libver"); } void diff --git a/src/command/commands.c b/src/command/commands.c index bc1e162b..5d1ddf12 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -4081,6 +4081,16 @@ cmd_pgp(gchar **args, struct cmd_help_t help) cons_debug("No keys found"); } g_slist_free_full(keys, (GDestroyNotify)free); + } else if (g_strcmp0(args[0], "libver") == 0) { + const char *libver = p_gpg_libver(); + if (libver) { + GString *fullstr = g_string_new("Using libgpgme version "); + g_string_append(fullstr, libver); + cons_show("%s", fullstr->str); + g_string_free(fullstr, TRUE); + } else { + cons_show("Could not get libgpgme version"); + } } return TRUE; -- cgit 1.4.1-2-gfad0