-
Notifications
You must be signed in to change notification settings - Fork 20
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
Support deprecated options #331
Comments
I'm not sure if there can be a single unified approach for deprecation, but I'm open to implementing necessary bits so you can resolve your deprecation needs on your own :) Let's go over several possible scenarios:
What kind of deprecation do you have in your case? |
Thanks for taking the time to consider this. It's kind of a mix of 1, and 3. The cmdline argument is replaced by an entry in a config file, but I suppose in your domain, it's mostly just 1. To be more detailed, previously scales for various outputs were specified via commandline: /// Scaling values for outputs
///
/// Example: In order to have eDP-1 scaled to 2.0 and DP-1 to 1.0:
/// eDP-1=2.0,DP-4=1.0
#[bpaf(argument::<OutputScales>, env("SBRY_SCALING"), help("DEPRECATED!!!"))]
pub(crate) scaling: Option<OutputScales>, Now a ron config file serves the same purpose, but provides more information per output SudburyPolicy(
sloppy_focus: false,
outputs: [(name: "eDP-1", resx: 4096, scale: 1.5)],
) So in the case where the ron config has no entry for the given output, I can easily populate something with only a scale, but it gets messy in the case where the ron config has an entry, and a scale was specified on the commandline. |
I'd do something like this in your case #[bpaf(argument::<OutputScales>, env("SBRY_SCALING"), map(|_| warn_the_user()), fallback(()), hide]
pub(crate) scaling: (),
But overall the problem is interesting, I'll think about making it easier to access. |
Cool. Feel free to close. I'll use your suggestion until something better comes along |
It would be helpful to have a unified way to express an argument is going to be deprecated (and may not work) at some future point. Bonus points if it could re-use
#[deprecated]
attributeThe text was updated successfully, but these errors were encountered: