Skip to content
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

Enhancement: Make self mutable in config::Override<xxxConfig>.override_config() #245

Open
JRAndreassen opened this issue Apr 14, 2020 · 1 comment

Comments

@JRAndreassen
Copy link

First, great framework...

One question.
Is it possible to make the self parameter mutable ?
I have standard libraries that I call from several executables.
In order to set missing / default parameters or override when they have specific
or standard overrides I need to update the parameters from the commandline.
I tried by setting Command::default, but it was not set.
so, if it was possible to change:
impl config::Override for XXXCmd {
fn override_config(
&self,
mut config: XXXConfig,

to
fn override_config(
&mut self,
mut config: XXXConfig,

Or add :
fn override_parameters(&mut self...)

it would solve the problem...

@aawsome
Copy link

aawsome commented May 8, 2023

You could do it vice versa and use the value from the configuration instead of the one given by the commandline in your code.
Then, use override_config to set/override the configuration value depending on the commandline args.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants