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

Load from config #457

Open
vcifello opened this issue Sep 14, 2023 · 3 comments
Open

Load from config #457

vcifello opened this issue Sep 14, 2023 · 3 comments

Comments

@vcifello
Copy link

vcifello commented Sep 14, 2023

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

  1. args "--email a@goog.com"
    2.don't pass --email at all, then the config emails are loaded into the email option ???
  2. is this possible?

Seems like this should be handled as follows:

  1. "--email a@goog.com"
  2. "--email" no argument specified so load from config throw error if nothing there
  3. 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

@ajalt
Copy link
Owner

ajalt commented Sep 14, 2023

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)

@vcifello
Copy link
Author

vcifello commented Sep 15, 2023

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 a@b.c sends email to a@b.c
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 a@b.c -> email = [a@b.c]
--email -> email = [default, config, emails, if, present]
no argument -> email = null

Is there a way to do this?

@ajalt
Copy link
Owner

ajalt commented Sep 15, 2023

Maybe I'm confused, but why are you setting up a config file that you don't want to use?

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