Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Parse additional config file information to be merged into existing config object #25

Closed
kesmit13 opened this issue Jun 6, 2015 · 1 comment

Comments

@kesmit13
Copy link

kesmit13 commented Jun 6, 2015

Maybe this is possible already, but it isn't obvious. I'd like to parse arguments and config files at startup, but then add an additional config (either file or string contents of file) at a later time. The existing config would be updated with the settings from the new information.

@bw2
Copy link
Owner

bw2 commented Nov 9, 2015

This is a hack, but should work:

parser = configargparse.Parser(..)
initial_args = parser.parse_args()

parser._default_config_files.append("config_file2.ini")
updated_args = parser.parse_args()

If this is useful (especially to more than one person) I could add a method like add_config_file(..) to the api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants