Skip to content

Commit

Permalink
BUG(cli): crash with explicit config file names (#113)
Browse files Browse the repository at this point in the history
Fixes a bug where passing an explicit config file name crashes the
argument parsing.

Closes: #112
  • Loading branch information
ntessore authored Feb 7, 2024
1 parent 58c882c commit d06de4c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion heracles/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,6 @@ def add_command(func):
cmd_parser.add_argument(
"-c",
"--config",
default="heracles.cfg",
help="configuration file (can be repeated)",
metavar="<config>",
action="append",
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit d06de4c

Please sign in to comment.