diff options
author | Werner Koch <[email protected]> | 2019-03-25 14:13:59 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-03-25 14:13:59 +0000 |
commit | 70c97a862aa586c314a64190d1e489a272e552ea (patch) | |
tree | 906db5af747f2a8af15c64a02c3d8d90f897182d /tools/gpg-wks-client.c | |
parent | doc: Clarify option --no-keyring. (diff) | |
download | gnupg-70c97a862aa586c314a64190d1e489a272e552ea.tar.gz gnupg-70c97a862aa586c314a64190d1e489a272e552ea.zip |
wkd: New command --print-wkd-url for gpg-wks-client.
* tools/gpg-wks-client.c (aPrintWKDURL): New.
(opts): Add option.
(main): Implement.
* tools/wks-util.c (wks_cmd_print_wkd_url): New.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tools/gpg-wks-client.c')
-rw-r--r-- | tools/gpg-wks-client.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/gpg-wks-client.c b/tools/gpg-wks-client.c index 2c40d7e17..861a1fc61 100644 --- a/tools/gpg-wks-client.c +++ b/tools/gpg-wks-client.c @@ -62,6 +62,7 @@ enum cmd_and_opt_values aInstallKey, aRemoveKey, aPrintWKDHash, + aPrintWKDURL, oGpgProgram, oSend, @@ -93,6 +94,8 @@ static ARGPARSE_OPTS opts[] = { "remove a key from a directory"), ARGPARSE_c (aPrintWKDHash, "print-wkd-hash", "Print the WKD identifier for the given user ids"), + ARGPARSE_c (aPrintWKDURL, "print-wkd-url", + "Print the WKD URL for the given user id"), ARGPARSE_group (301, ("@\nOptions:\n ")), @@ -236,6 +239,7 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts) case aInstallKey: case aRemoveKey: case aPrintWKDHash: + case aPrintWKDURL: cmd = pargs->r_opt; break; @@ -384,13 +388,24 @@ main (int argc, char **argv) break; case aPrintWKDHash: + case aPrintWKDURL: if (!argc) - err = proc_userid_from_stdin (wks_cmd_print_wkd_hash, "printing hash"); + { + if (cmd == aPrintWKDHash) + err = proc_userid_from_stdin (wks_cmd_print_wkd_hash, + "printing WKD hash"); + else + err = proc_userid_from_stdin (wks_cmd_print_wkd_url, + "printing WKD URL"); + } else { for (err = delayed_err = 0; !err && argc; argc--, argv++) { - err = wks_cmd_print_wkd_hash (*argv); + if (cmd == aPrintWKDHash) + err = wks_cmd_print_wkd_hash (*argv); + else + err = wks_cmd_print_wkd_url (*argv); if (gpg_err_code (err) == GPG_ERR_INV_USER_ID) { /* Diagnostic already printed. */ |