gpg: New option --import-filter
authorWerner Koch <wk@gnupg.org>
Fri, 1 Jul 2016 14:24:04 +0000 (16:24 +0200)
committerWerner Koch <wk@gnupg.org>
Fri, 1 Jul 2016 14:28:29 +0000 (16:28 +0200)
commit5137bf73ccc98a72c2eeac148e4d4b5d58f0a854
tree1649345e632dcc2198b1ee96dafe80c019554b4c
parentf015552374d69e28292a12f2b91ab34d65c9b457
gpg: New option --import-filter

* g10/gpg.c (oImportFilter): New.
(opts): Add --import-filter.
(main): Handle option.
* g10/import.c: Include recsel.h, init.h, and mbox-util.h.
(import_keep_uid): New global var.
(cleanup_import_globals): New.
(parse_and_set_import_filter): New.
(filter_getval): New.
(apply_keep_uid_filter): New.
(import_one): Apply filter if set.
--

Funny new option.  It can for example be used to export a key with
only one user id:

  gpg --no-options --import --import-options import-export \
      --import-filter keep-uid='mbox=wk@gnupg.org'         \
     < full-key.pub > key-with-one-uid.pub

More features will eventually be added.

Signed-off-by: Werner Koch <wk@gnupg.org>
doc/gpg.texi
g10/gpg.c
g10/import.c
g10/main.h