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

ddev snapshot --list output could be easier to read #6116

Open
1 task done
bmartinez287 opened this issue Apr 18, 2024 · 3 comments
Open
1 task done

ddev snapshot --list output could be easier to read #6116

bmartinez287 opened this issue Apr 18, 2024 · 3 comments

Comments

@bmartinez287
Copy link
Collaborator

bmartinez287 commented Apr 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem?

Is super hard to visually parse snapshots once you get more than 3 and the date attached to the file name is handy development wise but if i rename the file i lose that info. Also, the dates can be easier to read as part of a new field.

Describe your solution

Screenshot 2024-04-18 at 2 11 44 PM
I like how DDEV describe adds a nice easy to read table.

It be nice if ddev snapshot --list had the following columns instead of the paragraph which is harder to parse visually.

Name - Created on - Location

Extra credit.

Also this might be a slightly different issue but as seen in the picture below there is no
ddev snapshot restore [name] Example.

So the one thing I'm sure some including me have to do is go into the docs to find how to restore a file.
Knowing how to restore a file should be the first or second example on that list.

Screenshot 2024-04-18 at 2 00 54 PM

@bmartinez287 bmartinez287 changed the title DDEV snapshot --list could be better ddev snapshot --list could be easier to read Apr 18, 2024
@bmartinez287 bmartinez287 changed the title ddev snapshot --list could be easier to read ddev snapshot --list output could be easier to read Apr 18, 2024
@bmartinez287
Copy link
Collaborator Author

Seems like this be mostly modifying the command below.
https://github.com/ddev/ddev/blob/master/cmd/ddev/cmd/snapshot.go#L59

Looks like this does the list
https://github.com/ddev/ddev/blob/master/cmd/ddev/cmd/list.go
but i haven't found where the template for that table output is at.

Looks like this should address the extra section above.
https://github.com/ddev/ddev/blob/master/cmd/ddev/cmd/snapshot.go#L28

@bmartinez287
Copy link
Collaborator Author

Found it https://github.com/ddev/ddev/blob/master/pkg/ddevapp/list.go#L101
Mmm, maybe it can be extracted and use to replace the outcome from
https://github.com/ddev/ddev/blob/master/pkg/ddevapp/snapshot.go#L71

@rfay
Copy link
Member

rfay commented Apr 19, 2024

Real extra credit: Use Bubbletea and family,

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

No branches or pull requests

2 participants