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

Add a "prune" command #181

Closed
dvaumoron opened this issue Jun 22, 2024 · 11 comments
Closed

Add a "prune" command #181

dvaumoron opened this issue Jun 22, 2024 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@dvaumoron
Copy link
Contributor

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 ?

@dvaumoron dvaumoron added the enhancement New feature or request label Jun 22, 2024
@dvaumoron dvaumoron self-assigned this Jun 22, 2024
@Nmishin
Copy link
Collaborator

Nmishin commented Jun 22, 2024

sounds great!

@kvendingoldo
Copy link
Collaborator

Agree, that we need to have such command

@kvendingoldo
Copy link
Collaborator

But, started to think about it ... Maybe we can improve uninstall command instead of adding a new one?

@Nmishin
Copy link
Collaborator

Nmishin commented Jun 22, 2024

yes, something like uninstall --all ?

@dvaumoron
Copy link
Contributor Author

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

@dvaumoron
Copy link
Contributor Author

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)

@dvaumoron
Copy link
Contributor Author

I thought about storing last use date of each version to allow an uninstall based on version not used recently

@kvendingoldo
Copy link
Collaborator

kvendingoldo commented Jun 23, 2024

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.

@samuel-phan
Copy link
Contributor

I think what suits most of users would be this:

1. Interactive uninstallation

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.
  • Start typing characters to jump to any matching choice (incremental search). Eg: start typing 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.

2. Uninstall all

Uninstall all versions of a given tool:

tenv tf uninstall --all

Uninstall all versions of all tools:

tenv uninstall --all

3. Uninstall based on different ways of selection

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.

dvaumoron added a commit that referenced this issue Jul 6, 2024
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
dvaumoron added a commit that referenced this issue Jul 7, 2024
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
dvaumoron added a commit that referenced this issue Jul 7, 2024
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
dvaumoron added a commit that referenced this issue Jul 7, 2024
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
dvaumoron added a commit that referenced this issue Jul 7, 2024
* improve uninstall  #181
* uninstall cli help #181
* update README, uninstall part #181

Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
@dvaumoron
Copy link
Contributor Author

TODOs :

  • interactive uninstallation without arg
  • display last use date within tenv <tool> list

dvaumoron added a commit that referenced this issue Jul 13, 2024
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
dvaumoron added a commit that referenced this issue Jul 13, 2024
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
dvaumoron added a commit that referenced this issue Jul 14, 2024
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
dvaumoron added a commit that referenced this issue Jul 14, 2024
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
dvaumoron added a commit that referenced this issue Jul 14, 2024
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
dvaumoron added a commit that referenced this issue Jul 14, 2024
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
dvaumoron added a commit that referenced this issue Jul 14, 2024
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
dvaumoron added a commit that referenced this issue Jul 14, 2024
* interactive uninstall #181
* update uninstall cli help #181
* update README, uninstall part
* interactive uninstall help #181

Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
@dvaumoron
Copy link
Contributor Author

v2.5.0 is out

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

No branches or pull requests

4 participants