From dbb17426d0ea5924e4393a52ec787f66fcefcd9e Mon Sep 17 00:00:00 2001 From: Fabien Benureau Date: Sun, 17 Nov 2013 17:41:22 +0100 Subject: [PATCH] add_cmd: fix bug --- pubs/commands/add_cmd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pubs/commands/add_cmd.py b/pubs/commands/add_cmd.py index 0613568..d892684 100644 --- a/pubs/commands/add_cmd.py +++ b/pubs/commands/add_cmd.py @@ -11,8 +11,8 @@ from .. import templates def parser(subparsers): parser = subparsers.add_parser('add', help='add a paper to the repository') - parser.add_argument('-b', '--bibfile', - help='bibtex, bibtexml or bibyaml file', default=None) + parser.add_argument('bibfile', nargs='?', default = None, + help='bibtex, bibtexml or bibyaml file') parser.add_argument('-d', '--docfile', help='pdf or ps file', default=None) parser.add_argument('-t', '--tags', help='tags associated to the paper, separated by commas', default=None) @@ -25,7 +25,7 @@ def parser(subparsers): return parser -def bibdata_from_editor(rp): +def bibdata_from_editor(ui, rp): again = True try: bibstr = content.editor_input(config().edit_cmd, @@ -68,7 +68,7 @@ def command(args): # get bibfile if bibfile is None: - bibdata = bibdata_from_editor(rp) + bibdata = bibdata_from_editor(ui, rp) else: bibdata_raw = content.get_content(bibfile) bibdata = rp.databroker.verify(bibdata_raw)