Skip to content

Commit

Permalink
bugfixes: parse_args & search_config
Browse files Browse the repository at this point in the history
  • Loading branch information
perrette committed Apr 26, 2023
1 parent 94dcc54 commit 78ea7a2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions papers/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,9 @@ def get_parser(config=None):
def main():

config = Config()
configfile = search_config([os.path.join(".papers", "config.json")], start_dir=".")
configfile = search_config([os.path.join(".papers", "config.json")], start_dir=".", default=CONFIG_FILE)
if not os.path.exists(configfile):
configfile = None

if configfile is None:
installed = False
Expand All @@ -843,7 +845,10 @@ def main():
papers.config.DRYRUN = o.dry_run

subp = subparsers.choices[o.cmd]
vars(o).update(vars(subp.parse_args(args)))
# arguments are already parsed, but we can now process error message
# with subparser:
if args:
subp.parse_args(args)

if o.cmd == 'status':
return statuscmd(subp, o, config)
Expand Down

0 comments on commit 78ea7a2

Please sign in to comment.