feat(cmd add): exclude bibtex fields if specified

This commit is contained in:
Mitsuhiro Nakamura 2021-12-10 14:36:25 +09:00
parent 80867675b3
commit 5a10a5631b

View File

@ -116,6 +116,12 @@ def command(conf, args):
if bibentry is None: if bibentry is None:
ui.error('invalid bibfile {}.'.format(bibfile)) 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
citekey = args.citekey citekey = args.citekey