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

Add option to ignore previous config files #255

Open
mathisloevenich opened this issue Oct 28, 2021 · 3 comments
Open

Add option to ignore previous config files #255

mathisloevenich opened this issue Oct 28, 2021 · 3 comments

Comments

@mathisloevenich
Copy link

If default_config_files is set to:

["/etc/conf/app_config.ini",
 "/etc/conf/conf-enabled/*.ini",
 "~/.my_app_config.ini",
 "./app_config.txt"]

It would be nice to be able to tell which one was used.

Something like:
get_used_config_path()

Or let parse_args return the used config path if found

@mathisloevenich mathisloevenich changed the title Return which config file was used Add option to ignore previous config files Oct 28, 2021
@mathisloevenich
Copy link
Author

mathisloevenich commented Oct 28, 2021

I recognized the following behaviour:

/etc/conf/app_config.ini

value = 1
ignore-value = 2

./app_config.txt

value = 100

parse_args() returns:
Namespace(value=100, ignore_value=1)

But it would be nice to actually ignore previous variables and config files

What I want to get is:
Namespace(value=100)

@mathisloevenich
Copy link
Author

and then obviously it would be nice to know which one was used (if there are multiple config files found)

@bw2
Copy link
Owner

bw2 commented Jan 26, 2022

The format_values() method reports where an arg came from.
The ignore behavior is not something that many people would want AFAIK.

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