asdf icon indicating copy to clipboard operation
asdf copied to clipboard

`asdf shell --unset` to unset all plugin shell versions

Open zachallaun opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe

I work on projects that work with multiple versions of multiple packages managed by asdf. Generally, these projects have a .tool-versions that sets the "canonical" version for the project, but I will frequently use asdf shell <plugin> <version> to override the version for a time.

Going back to the .tool-versions or global defaults requires running asdf shell <plugin> --unset for each plugin I've set, usually followed by asdf current to ensure that everything's been reset.

Describe the proposed solution

asdf shell <plugin> --unset unsets the env var override for an individual plugin; I propose adding asdf shell --unset to unset any env vars that have been set with asdf shell.

Describe similar asdf features and why they are not sufficient

asdf shell <plugin> --unset will unset an individual plugin but requires both typing the plugin name and running the command multiple times for each plugin you wish to unset.

Describe other workarounds you've considered

Beyond parsing the output of asdf current and running --unset on each plugin, I am not sure of a reasonable alternative.

zachallaun avatar Aug 13 '23 20:08 zachallaun

i like ur idea, but i think it would be better with param "--unset-all"

edvardsanta avatar Sep 05 '23 20:09 edvardsanta

what do u think?

https://github.com/asdf-vm/asdf/assets/75655486/df0841e7-3b24-43f8-8107-e99293c46520

edvardsanta avatar Sep 06 '23 03:09 edvardsanta

Nice! I love the visibility it gives to what was unset as well. Nice job.

zachallaun avatar Sep 06 '23 14:09 zachallaun