Closed dvaumoron closed 2 months ago
sounds great!
Agree, that we need to have such command
But, started to think about it ... Maybe we can improve uninstall command instead of adding a new one?
yes, something like uninstall --all
?
But, started to think about it ... Maybe we can improve uninstall command instead of adding a new one?
Yes, It could be done by improving the existing uninstall
yes, something like
uninstall --all
?
Should be part of the solution, however, that could be boring too, without auto installation (now disabled by default), you may have to launch a bunch of install command, hence the idea to filter and confirm (probably with version constraint, and maybe regexp, but i don't like the idea because constraint will be simpler to our user and there is no retrocompatibility need)
I thought about storing last use date of each version to allow an uninstall based on version not used recently
I thought about storing last use date of each version to allow an uninstall based on version not used recently
It's a brilliant idea. I think, that we can show user the statistic and ask him about deletion of version that wasn't been in use for a long time.
I think what suits most of users would be this:
Run without any version to uninstall => Text UI to select which versions to uninstall (with multi-selection)
tenv tf uninstall
Display text UI:
[ ] 1.0.0
[x] 1.2.3
[ ] 1.7.4
[x] 1.9.0
Up
/Down
keys to move the line cursor up & down.Page Up
/Page Down
to move the line cursor one page up & down.Ctrl Home
/Ctrl End
to move the line cursor to the top or end of the choices.1.2
will move the line cursor to version 1.2.3
in the example above. Give 2 or 3s to reset the incremental search.Space
: select the current version under the line cursor for uninstallation.Enter
: confirm the versions to uninstall. If none has been selected using Space
, then the current version under the line cursor is selected for uninstallation.Esc
: abort uninstallation.This UI can also be used for installation.
Uninstall all versions of a given tool:
tenv tf uninstall --all
Uninstall all versions of all tools:
tenv uninstall --all
Uninstall all TF versions starting with 1.3.
string:
tenv tf uninstall --regex ^1\.3\.
Uninstall all versions based on last usage (requires a tracking of last executed date time of a given version).
Uninstall all versions not used since a given date:
tenv tf uninstall --not-used-since=2024-06-30
Uninstall all versions not used for a given number of days:
tenv tf uninstall --not-used-for=30d
I don't recommend to use any other time unit than days (like months or years) because then you have to deal with calendar quirks (months with different number of days, etc.).
This uninstallation use case is already a corner case, so no need to invest too much in a master piece of engineering for 0.0001% of users.
TODOs :
tenv <tool> list
v2.5.0 is out
Is your feature request related to a problem? Please describe.
When you have installed a lot of version and need to remove most of them, it is pretty uncomfortable to do so one by one...
Describe the solution you'd like
I think a form of
tenv <tool> prune
with several kind of filter, a display of the list of version that will be uninstalled and a confirmation step would be great.Anyone has suggestion about that proposal ?