Closed tristanlatr closed 3 years ago
Maybe it would be good to fix #46 at the same time?
Could you say more about why you want this behavior? It seems to me like a very rare use-case and might be better-handled outside the library - by adding a getter for the self. _source_to_settings array, and checking that to throw this error. What do you think?
Also, calling the argument "no_config_file" seems confusing to me - as the wording makes me think it means something like "use this option when the config file is missing". Could you call it something like "forbidden_in_config_file" or "forbid_setting_via_config_file"?
I appreciate you adding types to some of the docs. For the no_config_file option, are you just trying to detect / help users figure out that they shouldn't put "help=True" or "version=True" in a config file? It seems like one use for "no_config_file" would be to exclude certain options from being written out via the "is_write_out_config_file_arg" arg.
I agree with you that a name like "forbidden_in_config_file" is more explicit.
This new option is indeed to prevent users to set options like --versions from the config file, is there another way to do that that I'm not aware ?
Thanks
Sorry I don't see this as a broadly useful feature. Perhaps we can revisit if additional people want this.
The docs of the new option read as follows:
I think it's a necessary thing to exclude some option from the configuration file sometime!