-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
API for shared arguments is a bit weird #383
Comments
If you add that |
@sgrif Also I forgot to mention that in v2 it supports passing borrowed Edit: Corrections |
Yup, I just missed this. Thanks. |
So
diesel_cli
has a use case where basically all of our commands take the same argument. You can see our exact code here: https://github.com/sgrif/diesel/blob/331f81c353ec0c7f0b6897cb80cb405b2d9120bb/diesel_cli/src/main.rs#L13-L42All of our commands except one take
--database-url
(and really it's not a big deal if it gets passed to that command as well). Right now, if I put that argument on theClap::App
instance, it requires that the command is run asdiesel --database-url=url migration run
, but I'd much rather it bediesel migration run --database-url=url
, or really just allow it basically anywhere. (As an aside, we're having to wrap the argument in a closure becauseArg
doesn't deriveClone
, but it probably could)Does this seem like a reasonable/common enough use case to warrant support within clap itself?
The text was updated successfully, but these errors were encountered: