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

Feature Request: Clear All Config Settings #389

Open
starfishpatkhoo opened this issue Jan 21, 2025 · 5 comments
Open

Feature Request: Clear All Config Settings #389

starfishpatkhoo opened this issue Jan 21, 2025 · 5 comments

Comments

@starfishpatkhoo
Copy link

Description

Is there a simple way to just reset ALL of gsudo's config settings back to the gsudo default (known)?

I know we can just delete the registry keys HKLM\SOFTWARE\gsudo and HKCU\SOFTWARE\gsudo ... But a built-in "official" option so we don't need to run reg.exe ?

Proposed technical details

Clear Individual Config Setting (current method): gsudo config CacheMode --reset

Clear all Settings: gsudo config --reset-all

@starfishpatkhoo starfishpatkhoo changed the title Feature Request: Feature Request: Clear All Config Settings Jan 21, 2025
@JohnLGalt
Copy link

JohnLGalt commented Jan 22, 2025

https://github.com/gerardog/gsudo?tab=readme-ov-file#configuration

 gsudo config                          # Show current config settings & values.
 gsudo config {key} [--global] [value] # Read or write a user setting
 gsudo config {key} [--global] --reset # Reset config to default value
 --global                              # Affects all users (overrides user settings)

My understanding is that if you do not use a particular key value then you can reset the entire config both, per user as well as globally for all users.

@gerardog is this correct? If so, it could perhaps be explained instead of just having the code there.

@starfishpatkhoo
Copy link
Author

https://github.com/gerardog/gsudo?tab=readme-ov-file#configuration

 gsudo config                          # Show current config settings & values.
 gsudo config {key} [--global] [value] # Read or write a user setting
 gsudo config {key} [--global] --reset # Reset config to default value
 --global                              # Affects all users (overrides user settings)

My understanding is that if you do not use a particular key value then you can reset the entire config both, per user as well as globally for all users.

@gerardog is this correct? If so, it could perhaps be explained instead of just having the code there.

You're absolutely correct John, as I mentioned, you can gsudo config CacheMode --reset to clear the CacheMode setting back to factory default.

I meant to clear ALL config settings, for both User and Global back to default. Everything. So as I mentioned, one way is to simply delete both the HKLM and HKCU keys, and that works for sure. I guess I was merely suggesting an "official" way rather than by editing registry. ^_^

Sometimes, it helps to know that (or quickly set) a machine is confirmed to be in a known state - gsudo's factory defaults.

@JohnLGalt
Copy link

JohnLGalt commented Jan 22, 2025

Sorry, what I meant is if you gsudo config --reset - does that reset all settings?

But I tried it and that does not do what I expected it to. Hence your RFF lol. (I probably should have tried it first before posting - sorry!)

However, I think the above (with a warning before execution) would be good though. Or else a(nother) special argument such as gsudo config --all --reset to reset all settings at one time, if --reset-all seems unsuitable for any reason?

@starfishpatkhoo
Copy link
Author

But I tried it and that does not do what I expected it to. Hence your RFF lol. (I probably should have tried it first before posting - sorry!)

Ha ha! Yeah, it's an invalid parameter...

However, I think the above (with a warning before execution) would be good though. Or else a(nother) special argument such as gsudo config --all --reset to reset all settings at one time, if --reset-all seems unsuitable for any reason?

Either way works for me.. no preference...

Again, to note, one can simply reg delete the keys and that works, so the functionality is there.. so this is not like a high priority feature... Just suggesting that there should be a more "official" method.. and maybe also future proofing in case those keys are needed for something else in the future. ^_^

@gerardog
Copy link
Owner

Thanks for the suggestion, I'm including this in the next release 😃

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

3 participants