Load from config
Thanks for fixing the JSON issue!
Perhaps I am not thinking about this correctly, but it seems that the functionality around loading from config could be improved. For example, I want to use --email to send specified emails or default emails loaded from the config file. I don't see how to control this functionality.
The possible use cases: 1)specify emails from cli 2)use emails from config 3)don't send emails at all
- args "--email [email protected]" 2.don't pass --email at all, then the config emails are loaded into the email option ???
- is this possible?
Seems like this should be handled as follows:
- "--email [email protected]"
- "--email" no argument specified so load from config throw error if nothing there
- don't pass --email means do nothing
Sorry to bug you, especially if this is a solved issue - I tried to find an answer in the docs.
Thanks again
ps the numbering is getting messed up
If I understand what you're asking, that's already how it works. If an option is given on the cli, it's used and the config file is ignored for that option. If the option is not given on the cli, it will be read from the config file. If it's not in either place, that option will be null (or it's default value etc. will be used if defined)
Thanks ajalt. The last part is the problem. There is no way to have a config value, but NOT use it. It seems weird to me that NOT specifying an argument would result in the default values always being used.
Maybe my interface design is wrong.
--email [email protected] sends email to [email protected] no argument sends email to default values in config (if specified. which means you can't decide whether to use the default values or not)
Seems like I should be able to specify default values, but not load them if I wish.
--email [email protected] -> email = [[email protected]] --email -> email = [default, config, emails, if, present] no argument -> email = null
Is there a way to do this?
Maybe I'm confused, but why are you setting up a config file that you don't want to use?