From 5a10a5631b3ed7ac548d4f004bc3b48f651c0c3d Mon Sep 17 00:00:00 2001 From: Mitsuhiro Nakamura Date: Fri, 10 Dec 2021 14:36:25 +0900 Subject: [PATCH] feat(cmd add): exclude bibtex fields if specified --- pubs/commands/add_cmd.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pubs/commands/add_cmd.py b/pubs/commands/add_cmd.py index ada5e7c..e143fb2 100644 --- a/pubs/commands/add_cmd.py +++ b/pubs/commands/add_cmd.py @@ -116,6 +116,12 @@ def command(conf, args): if bibentry is None: ui.error('invalid bibfile {}.'.format(bibfile)) + # exclude bibtex fields if specified + for item in bibentry.values(): + for field in conf['main']['bibtex_field_excludes']: + if field in item: + del item[field] + # citekey citekey = args.citekey