Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions configargparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,13 +889,16 @@ def _open_config_files(self, command_line_args):
if not user_config_file_arg_actions:
return config_files

positional_args = [a for a in self._actions if getattr(a, "is_positional_arg", False)]

for action in user_config_file_arg_actions:
# try to parse out the config file path by using a clean new
# ArgumentParser that only knows this one arg/action.
arg_parser = argparse.ArgumentParser(
prefix_chars=self.prefix_chars,
add_help=False)

[arg_parser._add_action(a) for a in positional_args]
arg_parser._add_action(action)

# make parser not exit on error by replacing its error method.
Expand Down