-
-
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
fix: Ease clap2->3 transition for Settings #2907
Conversation
We haven't decided on #2617 yet. |
4003776
to
8ee7173
Compare
This brings back the old name of settings, just deprecated. Since they all map to the same bits in the bit field, this should work for `setting` and `is_set`. The only thing this lacks is being able to do equality across variants, whcih seems like a minority case. Removed settings have some extra care abouts that we'll need to look into separately. This is a part of clap-rs#2617
This partiall reverts commit efeb02c, bringing back the `AppSettins::Color*` and making them the backing store for `App::color`, to help ease the transition from clap2->3. Once we remove these deprecated settings, we might want to keep this backing store to save on memory. This is a part of clap-rs#2617
We prefer Settings to always be off by default, so when we change a default, we have to rename. This adds back in the now-default settings with deprecation messages to help the user know how things now work. Unfortunately, there is no way to notify the user that the default they relied on has changed. This also doesn't help us when the change in behavior is more than just an inverting, like `InvalidUtf8` or when a setting mapped to multiple bits.
I'm good with these changes. I think it will help the porting burden. We'll need to watch for any edge cases around the @pksunkara if we need to split off additional discussion in #2617 that isn't related to this PR or adding back in old, but compatible APIs with deprecation notices we can and probably should do that. I'm good with forwarding to new APIs with deprecation notices to make the porting process easier. |
bors r+ |
Build succeeded: |
In clap-rs#2851, we moved color from an AppSetting to function (with some tweaks in clap-rs#2907). When doing this, we documented `App::color` to be equivelant of `App::global_settings(Color...)` but never actually propogated it. We are now propogating it. A test is added to ensure that no matter how we store the color choice, we continue to propogate it. This required exposing `App::get_color`.
In clap-rs#2851, we moved color from an AppSetting to function (with some tweaks in clap-rs#2907). When doing this, we documented `App::color` to be equivalent of `App::global_settings(Color...)` but never actually propagated it. We are now propagating it. A test is added to ensure that no matter how we store the color choice, we continue to propagate it. This required exposing `App::get_color`.
This is handling non-behavior changes in Settings as part of #2617