From 4347ab66829599b59b4d33f85640ea8486fc24e3 Mon Sep 17 00:00:00 2001 From: Nicolas Tessore Date: Wed, 7 Feb 2024 09:56:36 +0000 Subject: [PATCH] BUG (cli): crash with explicit config file names Fixes a bug where passing an explicit config file name crashes the argument parsing. --- heracles/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/heracles/cli.py b/heracles/cli.py index a884517..68bff8d 100644 --- a/heracles/cli.py +++ b/heracles/cli.py @@ -734,7 +734,6 @@ def add_command(func): cmd_parser.add_argument( "-c", "--config", - default="heracles.cfg", help="configuration file (can be repeated)", metavar="", action="append", @@ -861,6 +860,10 @@ def add_command(func): main_parser.print_help() return 1 + # fix default config + if not args.files: + args.files = ["heracles.cfg"] + # get keyword args kwargs = vars(args) cmd = kwargs.pop("cmd")