summaryrefslogtreecommitdiff
path: root/tests/run-keylist.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-keylist.c')
-rw-r--r--tests/run-keylist.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/run-keylist.c b/tests/run-keylist.c
index 07c6fa1..8abdf43 100644
--- a/tests/run-keylist.c
+++ b/tests/run-keylist.c
@@ -53,6 +53,7 @@ show_usage (int ex)
" --ephemeral use GPGME_KEYLIST_MODE_EPHEMERAL\n"
" --validate use GPGME_KEYLIST_MODE_VALIDATE\n"
" --import import all keys\n"
+ " --offline use offline mode\n"
, stderr);
exit (ex);
}
@@ -72,6 +73,7 @@ main (int argc, char **argv)
int keyidx = 0;
gpgme_protocol_t protocol = GPGME_PROTOCOL_OpenPGP;
int only_secret = 0;
+ int offline = 0;
if (argc)
{ argc--; argv++; }
@@ -141,6 +143,11 @@ main (int argc, char **argv)
import = 1;
argc--; argv++;
}
+ else if (!strcmp (*argv, "--offline"))
+ {
+ offline = 1;
+ argc--; argv++;
+ }
else if (!strncmp (*argv, "--", 2))
show_usage (1);
@@ -157,6 +164,8 @@ main (int argc, char **argv)
gpgme_set_keylist_mode (ctx, mode);
+ gpgme_set_offline (ctx, offline);
+
err = gpgme_op_keylist_start (ctx, argc? argv[0]:NULL, only_secret);
fail_if_err (err);