From d06de4cafbb0113963a0a87419284f4ddf6350a4 Mon Sep 17 00:00:00 2001 From: Nicolas Tessore Date: Wed, 7 Feb 2024 10:01:41 +0000 Subject: [PATCH] BUG(cli): crash with explicit config file names (#113) Fixes a bug where passing an explicit config file name crashes the argument parsing. Closes: #112 --- 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")