From 1cd95bdeeccb3160fefc7fcbca42d57e803c1720 Mon Sep 17 00:00:00 2001 From: Dennis Wilson Date: Mon, 29 May 2017 11:43:30 +0200 Subject: [PATCH] overwrite argument on import --- pubs/commands/import_cmd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pubs/commands/import_cmd.py b/pubs/commands/import_cmd.py index 03935b4..b83249a 100644 --- a/pubs/commands/import_cmd.py +++ b/pubs/commands/import_cmd.py @@ -20,6 +20,8 @@ def parser(subparsers, conf): help="don't copy document files, just create a link.") parser.add_argument('keys', nargs='*', help="one or several keys to import from the file") + parser.add_argument('-O', '--overwrite', default=False, + help="Overwrite keys already in the database") return parser @@ -78,7 +80,7 @@ def command(conf, args): if isinstance(p, Exception): ui.error(u'Could not load entry for citekey {}.'.format(k)) else: - rp.push_paper(p) + rp.push_paper(p, overwrite=args.overwrite) ui.info(u'{} imported.'.format(color.dye_out(p.citekey, 'citekey'))) docfile = bibstruct.extract_docfile(p.bibdata) if docfile is None: