structopt-toml icon indicating copy to clipboard operation
structopt-toml copied to clipboard

options without default-value

Open nycex opened this issue 4 years ago • 1 comments

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.

nycex avatar Oct 30 '21 22:10 nycex

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!

Boscop avatar May 04 '22 20:05 Boscop