diff options
author | Werner Koch <wk@gnupg.org> | 2016-07-01 16:50:12 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2016-07-01 16:50:12 +0200 |
commit | 7bfc86c938d11c14ea78b196c82ceba2a2f5317d (patch) | |
tree | 00e1e8b7b2c1bab6c449ffb396742c034162f585 /g10/gpg.c | |
parent | gpg: New option --import-filter (diff) | |
download | gnupg2-7bfc86c938d11c14ea78b196c82ceba2a2f5317d.tar.xz gnupg2-7bfc86c938d11c14ea78b196c82ceba2a2f5317d.zip |
gpg: New option --export-filter
* g10/gpg.c (oExportFilter): New.
(opts): Add --export-filter.
(main): Handle option.
* g10/export.c: Include recsel.h, init.h, and mbox-util.h.
(export_keep_uid): New global var.
(cleanup_export_globals): New.
(parse_and_set_export_filter): New.
(filter_getval): New.
(apply_keep_uid_filter): New.
(do_export_stream): Apply filter if set.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/gpg.c')
-rw-r--r-- | g10/gpg.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -302,6 +302,7 @@ enum cmd_and_opt_values oImportOptions, oImportFilter, oExportOptions, + oExportFilter, oListOptions, oVerifyOptions, oTempDir, @@ -575,6 +576,7 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_s (oImportOptions, "import-options", "@"), ARGPARSE_s_s (oImportFilter, "import-filter", "@"), ARGPARSE_s_s (oExportOptions, "export-options", "@"), + ARGPARSE_s_s (oExportFilter, "export-filter", "@"), ARGPARSE_s_s (oListOptions, "list-options", "@"), ARGPARSE_s_s (oVerifyOptions, "verify-options", "@"), @@ -3049,6 +3051,11 @@ main (int argc, char **argv) log_error(_("invalid export options\n")); } break; + case oExportFilter: + rc = parse_and_set_export_filter (pargs.r.ret_str); + if (rc) + log_error (_("invalid filter option: %s\n"), gpg_strerror (rc)); + break; case oListOptions: if(!parse_list_options(pargs.r.ret_str)) { |