Replies: 1 comment
-
Validation of possible values happens before we can guarantee all arguments are parsed and before the caller has access to them. What you'd most likely need to do is to remove clap validation from the field and defer that until after parsing has happened. As for
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I have a CLI which is loading possible values from some lazy static structs which is parsed from a config file.
With the following possible value parser:
Initializing some toml parsed settings:
So far so good but now we want to add some arg to define a non default path to load
Settings
from.This gets tricky because now possible values would be loaded from the wrong setting file (or the default impl) when using the new
--config
arg.I was wondering if anyone had gone through a similar issue and if there was an idiomatic way to solve this with clap.
For more context you can take a look at the related issue here: cocogitto/cocogitto#344
Beta Was this translation helpful? Give feedback.
All reactions