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

options without default-value #14

Open
nycex opened this issue Oct 30, 2021 · 1 comment
Open

options without default-value #14

nycex opened this issue Oct 30, 2021 · 1 comment

Comments

@nycex
Copy link

nycex commented Oct 30, 2021

I'm not sure if this is possible with the approach the crate uses, but I think it would be nice if you could have options that must be specified at least either in the cli arguments or in the toml, but cannot be omitted entirely.

An exemplary use-case would be a hostname, which should not have any default-value, but could be configured in either the config or overwritten in the arguments (and would also work without being specified in the config).

Currently, this doesn't work as structopt instantly errors with The following required arguments were not provided: without even checking the config.toml.

@Boscop
Copy link

Boscop commented May 4, 2022

Yes, please!
It took me a long time to find out WHY it says error: The following required arguments were not provided even though I provided them in the toml file!
In my case, both were PathBuf for which it makes no sense to have a default value!

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