Replies: 1 comment 3 replies
-
I am not exactly sure what you are asking or trying to do. Need more information. And I don't think we really care about the extra fields. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
👋 Thanks so much for building
clap
, it makes Rust CLIs a joy to write!I'm working on a small project right now where I'm using
<bin>.yaml
files to build up multiple binaries. Each<bin>.yaml
file generates a different binary.For each generated binary the
clap::App
and everyclap::Arg
have a few extra settings that I want users to be able to configure at build-time. Right now I'm handling this by splitting each binary into two configs:<bin>.yaml
file for building the Clap CLI (this will be used for internationalization)yaml
file that provides some extra data for eachclap::App
and everyclap::Arg
used in the application logic.Ideally, I'd like to include the values from #2 in the binary-specific yaml files (
<bin>.yaml
) as extra fields and then either (a) fetch the extra data with aArgMatch::value_of("metadata")
or (b) allow the extra field to exist in the From trait and manually parse it myself.Would y'all be open to either approach? Do you have other suggestions for how I could go about solving this?
PS - As part of investigating this yesterday, I noticed that the From trait validates the fields on the Args but doesn't validate the fields on the App? I'm not sure if this is intentional or an oversight, but the behavior seems inconsistent. I created a minimal example showcasing the inconsistent behavior. Let me know if you'd like me to open an issue.
Beta Was this translation helpful? Give feedback.
All reactions