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 export in interactive #298

Merged
merged 5 commits into from
Feb 13, 2024
Merged

Conversation

kadogo
Copy link
Contributor

@kadogo kadogo commented Feb 10, 2024

Hello

I don't really know Go, so it was trial and error for the most of it.
It would fix #141, but you are free to do any modification to the PR.
I did a few little tests, and it looks like it is working as expected.

I'm pretty sure that the code would be better that what I have done, that, I think, is also a bit dirty...

When launching GDU the argument -e is used to define the path of the dump when we will press S (uppercase s) in the interactive mode.

I didn't try to do a progress bar because I felt like it was another level, but the save looks pretty fast, so maybe it's alright.

Cheers

Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (4e65a50) 93.58% compared to head (51797c3) 90.16%.
Report is 41 commits behind head on master.

Files Patch % Lines
tui/actions.go 74.19% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #298      +/-   ##
==========================================
- Coverage   93.58%   90.16%   -3.43%     
==========================================
  Files          29       31       +2     
  Lines        2806     3345     +539     
==========================================
+ Hits         2626     3016     +390     
- Misses        139      267     +128     
- Partials       41       62      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dundee dundee merged commit 6407b17 into dundee:master Feb 13, 2024
10 checks passed
@dundee
Copy link
Owner

dundee commented Feb 13, 2024

Nice contribution, thank you!

@kadogo kadogo deleted the add-export-in-interactive branch February 13, 2024 22:36
@kadogo
Copy link
Contributor Author

kadogo commented Feb 13, 2024

Thank you and you are welcome, when I see your updates it looks much better than my "pull together" thing ^^

I will give the new version a try in the week, based on the code I see window and stuff like that it sounds interesting ^^

@dundee
Copy link
Owner

dundee commented Feb 13, 2024

Yes, my idea was that the user might not know that he will want to export the data later, so he might not add the option --export-file. Therefore I introduced an input field where you can specify the file name.

Not sure yet when I will release this as a next version. There is still some stuff that I would like to include.

But you can install the master version using:

go install github.com/dundee/gdu/v5/cmd/gdu@master

@kadogo
Copy link
Contributor Author

kadogo commented Feb 14, 2024

No problem, I'm not in a hurry. I took 1 year before giving a try to the PR ^^

I gave it a try to the command, and it's working well.
Having the window really make a big difference and let also export on the fly without worrying about the older filenames, thank you.

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

Successfully merging this pull request may close these issues.

Feature: Export JSON from interactive mode
2 participants